- Class
- 4xx client error
- Defined in
- RFC 9110, section 15.5.11
- Retry
- No
- Fix
- Move to the replacement
- Cacheable by default
- Yes
When your API should return 410
Return 410 when you retire an API version or an endpoint after its deprecation period, or for a resource you deleted and remember deleting. Put a link to the replacement and the shutdown date in the body, so the developer who hits it knows where to go.
If you don’t know whether the thing ever existed, return a 404. Before a 410, announce the removal with Deprecation and Sunset headers on the working endpoint, so clients get months of notice in every response.
How public APIs declare 410 in their OpenAPI specs
Two of the eleven public specs we score declare a 410, as they were on 4 December 2026. GitHub does on 42 operations and OpenAI on 6.
Everyone else is silent on it, which is common. Most APIs remove endpoints rarely, and a spec describes what exists today.
| API | Operations | Declare 410 | How errors are described |
|---|---|---|---|
| GitHub | 1,288 | 42 | Per status code |
| OpenAI | 406 | 6 | Per status code |
| Stripe | 612 | 0 | One default error response |
| Plaid | 351 | 0 | One default error response |
| Asana | 302 | 0 | Per status code |
| Box | 297 | 0 | Per status code, plus a default |
| Twilio | 197 | 0 | No error responses |
| Slack | 174 | 0 | One default error response |
| Adyen Checkout | 28 | 0 | Per status code |
| Swagger Petstore | 19 | 0 | Per status code, plus a default |
| SendGrid Mail | 3 | 0 | Per status code |
Counted per operation from each vendor’s public OpenAPI document on 4 December 2026.
Declare 410 in your OpenAPI spec
A removed operation usually leaves the spec, so declare the 410 while the operation is deprecated and still listed, with its shutdown date.
paths:
/v1/reports:
get:
operationId: listReportsV1
deprecated: true
description: Replaced by /v2/reports. Returns 410 after 1 June 2027.
responses:
"200":
$ref: "#/components/responses/ReportList"
"410":
description: This endpoint was retired. Use /v2/reports.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"What an Octri SDK does with a 410
A 410 has no error class of its own in an Octri SDK. The caller gets an SdkHttpError with statusCode 410, and the SDK doesn’t retry it.
Octri’s API docs show a Deprecated badge on every operation your spec marks deprecated: true, so readers see the warning long before the 410 arrives.
import { Acme, SdkHttpError } from "acme-sdk";
const acme = new Acme({ apiKey: process.env.ACME_API_KEY });
try {
await acme.reports.listV1();
} catch (err) {
if (err instanceof SdkHttpError && err.statusCode === 410) {
// Retired. The body names the replacement endpoint.
console.log(err.data);
}
throw err;
}More on retries and typed errors in SDK error handling.
HTTP 410 questions
Is 410 better than 404 for search engines?
Yes, a little. Google has said it drops a 410 URL from its index slightly sooner than a 404, though both end up removed.
Should a retired API version redirect?
No, not for calls that change data. Some clients turn a redirected POST into a GET, so a 410 with a link to the new version is safer.
Should a 410 stay in place forever?
Partly. Keep it for as long as old SDK versions are still installed, since a 410 explains the failure and a 404 makes the developer wonder about a typo.