Prompt

How do I add deprecation notices to API docs?

Technology / Documentation Tools1 observationLast seen Oct 16, 2026

Latest observation

Oct 16, 2026OpenAI APIWeb search: off

To add deprecation notices to API docs, the best approach depends on what documentation stack you use, but the general pattern is:

  1. Mark the API element as deprecated in code/spec
  2. Include a clear deprecation message in the docs
  3. State the replacement and timeline
  4. Keep it visible in generated docs and changelogs

Common ways to do it

1) OpenAPI / Swagger

Use the deprecated: true flag on an operation, parameter, or schema property.

paths:
  /v1/users:
    get:
      deprecated: true
      summary: List users
      description: |
        Deprecated. Use `/v2/users` instead.

You can also add:

  • description with migration guidance
  • x-deprecation-date or similar vendor extension
  • links to replacement endpoints

Example:

get:
  deprecated: true
  description: |
    Deprecated as of 2026-01-01.
    Use `GET /v2/users` instead.
    Removal planned for 2026-07-01.

2) JavaScript/TypeScript docs

Use JSDoc @deprecated:

/**
 * @deprecated Use getUserV2 instead.
 */
function getUser() {}

This often shows up in IDE tooltips and generated docs.

3) Python docs

Use docstrings plus warnings in runtime, and mention deprecation in the docstring:

def get_user():
    """
    Deprecated. Use get_user_v2 instead.
    """

If appropriate, emit a DeprecationWarning when called.

4) Markdown / static docs

Add a prominent callout:

Deprecated: This endpoint will be removed on 2026-07-01. Use GET /v2/users instead.

Or use your docs system’s alert/admonition syntax:

> **Deprecated**
> Use `/v2/users` instead. Removal planned for 2026-07-01.

5) SDK / language annotations

Many languages support deprecation annotations:

  • Java: @Deprecated
  • C#: [Obsolete("Use ...")]
  • Go: doc comment starting with the symbol name and Deprecated: ...

Example in Go:

// Deprecated: Use GetUserV2 instead.
func GetUser() {}

What a good deprecation notice should include

  • What is deprecated
  • Why / what to use instead
  • When it will be removed
  • Any migration steps
  • Whether it still works for now

Example wording:

Deprecated: GET /v1/users is deprecated and will be removed on 2026-07-01. Use GET /v2/users instead. The response schema is mostly unchanged; only pagination differs.

Best practices

  • Make it visible in generated docs and not buried in a changelog
  • Be specific about the replacement
  • Provide a timeline
  • If possible, emit runtime warnings too
  • Keep deprecation consistent across docs, SDKs, and API responses

If you tell me what docs format you’re using (OpenAPI, Swagger UI, Redoc, Docusaurus, MkDocs, etc.), I can show the exact syntax.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.