← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

API Deprecation

API Design Intermediate
debt(d7/e5/b5/t7)
d7 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'only careful code review or runtime testing' (d7). The detection_hints indicate automated detection is 'no'. While OpenAPI specs and Datadog can help identify deprecated endpoints lacking Sunset headers, there's no automated enforcement that catches missing deprecation workflows at development time. The real failures — removing endpoints without notice, not tracking usage — are only discovered through careful review of API lifecycle practices or when production consumers break. Bumped slightly from d9 because tools like OpenAPI linting can flag missing deprecation metadata if configured.

e5 Effort Remediation debt — work required to fix once spotted

Closest to 'touches multiple files / significant refactor in one component' (e5). The quick_fix suggests adding Deprecation and Sunset headers, which sounds like a small change, but proper deprecation is more than headers — it requires setting up usage monitoring/logging per deprecated endpoint, publishing migration guides, coordinating with consumers, and managing the lifecycle across potentially many endpoints. This touches middleware, logging infrastructure, documentation, and monitoring dashboards. Not quite cross-cutting (e7) since it's contained within the API layer, but definitely more than a simple parameterised fix.

b5 Burden Structural debt — long-term weight of choosing wrong

Closest to 'persistent productivity tax' (b5). API deprecation applies to web/api contexts and is an ongoing process concern. Every API change that removes or modifies behavior must go through the deprecation lifecycle. This creates a persistent tax on teams: maintaining deprecated endpoints alongside new ones, monitoring usage, managing sunset timelines, and supporting consumers during migration windows. It shapes how teams plan releases but doesn't define the entire system architecture, so b7 would be too high.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap — contradicts how a similar concept works elsewhere' (t7). The misconception is highly revealing: developers believe removing an undocumented endpoint isn't a breaking change. This contradicts the intuitive mental model that 'undocumented = unsupported = safe to remove.' Hyrum's Law makes this a serious trap because the 'obvious' approach (just remove it, nobody should be using it) is wrong. Additionally, many developers coming from internal-only APIs or library deprecation (where you control all callers) will underestimate the impact on external consumers they can't see or coordinate with.

About DEBT scoring →

Also Known As

API sunset deprecation notice Sunset header

TL;DR

The process of signalling that an API version, endpoint, or parameter will be removed — giving consumers time to migrate while maintaining backwards compatibility.

Explanation

API deprecation follows a lifecycle: announce, deprecate (still works, signals removal), sunset (stop accepting new integrations), remove. The Sunset HTTP header (RFC 8594) carries the removal date. Deprecation-Warning response headers flag deprecated endpoints. Semver breaking changes require a major version bump. In practice: give consumers at least 6-12 months notice, provide a migration guide, log deprecated endpoint usage to identify who still uses them before removal.

Diagram

flowchart LR
    V1[v1 endpoint active] -->|add v2| BOTH[v1 and v2 both active]
    BOTH -->|announce sunset| DEP[v1 deprecated<br/>Deprecation header added<br/>Sunset: date header]
    DEP -->|sunset date reached| GONE[v1 removed<br/>410 Gone response]
    subgraph Communication
        DOCS[Update API docs]
        EMAIL[Email API consumers]
        HEADER[Deprecation: true<br/>Link: migration guide]
        MONITOR[Monitor v1 traffic<br/>contact active users]
    end
    BOTH --> DOCS & EMAIL & HEADER & MONITOR
style V1 fill:#d29922,color:#fff
style GONE fill:#f85149,color:#fff
style BOTH fill:#238636,color:#fff

Common Misconception

Removing an undocumented endpoint is not a breaking change — Hyrum's Law guarantees someone depends on it; always announce removals regardless of documentation status.

Why It Matters

Silent API removal breaks consumer integrations with no warning — proper deprecation with the Sunset header gives consumers the time and signal to migrate before breakage.

Common Mistakes

  • Removing endpoints without a deprecation period — production integrations break with no warning.
  • Not including the Sunset date in the response header — consumers only discover the removal after it happens.
  • Too short a deprecation window — 2-week windows are insufficient for enterprise consumers with change management processes.
  • Not monitoring who uses deprecated endpoints — removes while active consumers exist.

Avoid When

  • Deprecating without a migration path — consumers cannot act on a deprecation notice with no alternative.
  • Deprecating with too short a sunset window — external consumers need months, not days, to migrate.
  • Removing deprecated endpoints without checking actual usage — monitor traffic before hard removal.

When To Use

  • Before any breaking change — deprecate the old behaviour, ship the new, give consumers time to migrate.
  • Communicating via Deprecation and Sunset HTTP headers so automated tooling can detect and alert.
  • Publishing a changelog and migration guide alongside the deprecation notice.
  • Setting a concrete sunset date — open-ended deprecations are ignored; deadlines create urgency.

Code Examples

✗ Vulnerable
// No deprecation notice — silent breaking change:
// Sprint 42: remove GET /api/v1/users/:id/preferences
// Deploy to production
// Consumer monitoring alerts fire — integration broken with no warning
✓ Fixed
// Deprecation with Sunset header:
HTTP/1.1 200 OK
Deprecation: true
Sunset: Sat, 01 Jan 2027 00:00:00 GMT
Link: <https://api.example.com/docs/migration/preferences>; rel="successor-version"

// Log deprecated endpoint usage:
if ($request->is('api/v1/users/*/preferences')) {
    $this->deprecationLog->record($request->route(), $apiKey);
    // Alert team when consumer count drops to 0 — safe to remove
}

Added 15 Mar 2026
Edited 25 Mar 2026
Views 58
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 1 ping W 1 ping T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 1 ping T 1 ping F 1 ping S 0 pings S 2 pings M 1 ping T 3 pings W 0 pings T 0 pings F 1 ping S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 1 ping T 0 pings W
No pings yet today
PetalBot 1
Amazonbot 14 Scrapy 6 Perplexity 5 Ahrefs 4 Google 3 SEMrush 3 Unknown AI 2 Claude 2 Majestic 1 Meta AI 1 PetalBot 1
crawler 39 crawler_json 3
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: Low
⚡ Quick Fix
Add Deprecation: true and Sunset: date headers to deprecated endpoints; log which clients are still calling deprecated paths; remove only after zero usage confirmed
📦 Applies To
any web api
🔗 Prerequisites
🔍 Detection Hints
Deprecated API endpoints without deprecation headers; no usage tracking on deprecated paths; immediate removal without notice period
Auto-detectable: ✗ No openapi datadog
⚠ Related Problems
🤖 AI Agent
Confidence: Medium False Positives: Medium ✗ Manual fix Fix: Medium Context: File


✓ schema.org compliant