- Class
- 5xx server error
- Defined in
- RFC 9110, section 15.6.2
- Retry
- No
- Fix
- Wait for support
- Cacheable by default
- Yes
When your API should return 501
Return 501 when your server doesn’t recognise the method at all, or when a documented feature isn’t available yet, like a parameter value reserved for a future release. RFC 9110 makes a 501 cacheable by default, so add Cache-Control: no-store if the feature might ship soon.
If the method is known and this resource doesn’t allow it, that’s a 405. If the feature exists and the account can’t use it, that’s a 403.
How public APIs declare 501 in their OpenAPI specs
Two of the eleven public specs we score declare a 501, as they were on 4 December 2026, on 2 operations each, Asana and OpenAI.
That’s about what you’d expect. A 501 describes something missing, and a spec mostly describes what exists.
| API | Operations | Declare 501 | How errors are described |
|---|---|---|---|
| OpenAI | 406 | 2 | Per status code |
| Asana | 302 | 2 | Per status code |
| GitHub | 1,288 | 0 | Per status code |
| Stripe | 612 | 0 | One default error response |
| Plaid | 351 | 0 | One default error response |
| 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 501 in your OpenAPI spec
Declare 501 on operations where some options aren’t supported yet, and say which in the description.
paths:
/exports:
post:
operationId: createExport
responses:
"202":
$ref: "#/components/responses/ExportQueued"
"501":
$ref: "#/components/responses/FormatNotSupported"
components:
responses:
FormatNotSupported:
description: The xlsx format isn't available yet. Use csv.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"What an Octri SDK does with a 501
An Octri SDK maps a 501 to SdkInternalServerError, like every 5xx, and doesn’t retry it. Its default retry list includes 500, 502, 503 and 504 and leaves 501 out, because the answer won’t change on the next attempt.
Check statusCode on the error to tell the two apart, since a 501 calls for a fallback in your code and a 500 calls for a bug report.
import { Acme, SdkInternalServerError } from "acme-sdk";
const acme = new Acme({ apiKey: process.env.ACME_API_KEY });
async function startExport() {
try {
return await acme.exports.create({ format: "xlsx" });
} catch (err) {
// 501: xlsx isn't supported yet, so fall back to csv.
if (err instanceof SdkInternalServerError && err.statusCode === 501) {
return acme.exports.create({ format: "csv" });
}
throw err;
}
}More on retries and typed errors in SDK error handling.
HTTP 501 questions
Is a 501 a server bug?
No. It’s a deliberate answer that the server doesn’t support the request. It sits in 5xx because the limit is the server’s, and it shouldn’t page anyone.
Should a 501 say when the feature will ship?
Yes, if you know. A date or a link to your changelog in the body lets the developer plan around it.
Can a 501 come from a proxy?
Yes. A proxy or load balancer that doesn’t support a method, like a WebDAV method, can return 501 before your API sees the request.