Skip to content

By the Octri team · Updated

410 Gone

Share

A 410 means the resource was here and has been removed for good, with no forwarding address. It’s a more definite answer than a 404, so clients and crawlers can stop asking.

All HTTP status codes

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.

APIOperationsDeclare 410How errors are described
GitHub1,28842Per status code
OpenAI4066Per status code
Stripe6120One default error response
Plaid3510One default error response
Asana3020Per status code
Box2970Per status code, plus a default
Twilio1970No error responses
Slack1740One default error response
Adyen Checkout280Per status code
Swagger Petstore190Per status code, plus a default
SendGrid Mail30Per 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.

yaml
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.

typescript
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.

Share