- Class
- 4xx client error
- Defined in
- RFC 6585, section 3
- Retry
- Yes, with If-Match
- Key header
- If-Match
- Cacheable by default
- No
When your API should return 428
Return 428 on PUT, PATCH or DELETE when the request has no If-Match and your API requires one. Without it a client can save over someone else’s change without knowing, and RFC 6585 added 428 to close that gap.
If the client did send If-Match and the ETag is stale, that’s a 412. Return 428 only where you enforce it, and say so in the docs, because clients written against other APIs won’t expect it.
How public APIs declare 428 in their OpenAPI specs
None of the eleven public specs we score declares a 428, as they were on 4 December 2026. Box takes If-Match on 8 operations and answers a stale one with 412, and leaves the header optional on all 8.
That fits how most APIs treat conditional writes. They’re there for clients that want them, and a client that sends none gets last-write-wins.
| API | Operations | Declare 428 | How errors are described |
|---|---|---|---|
| GitHub | 1,288 | 0 | Per status code |
| Stripe | 612 | 0 | One default error response |
| OpenAI | 406 | 0 | Per status code |
| 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 428 in your OpenAPI spec
Mark If-Match as required and declare 428 for requests that leave it out, next to the 412 for requests that send a stale one.
paths:
/invoices/{invoiceId}:
patch:
operationId: updateInvoice
parameters:
- name: If-Match
in: header
required: true
schema:
type: string
responses:
"200":
$ref: "#/components/responses/Invoice"
"412":
description: The ETag is stale. Read the invoice again.
"428":
description: Send If-Match with the ETag from your last read.What an Octri SDK does with a 428
A header parameter your spec declares becomes an argument of the generated method, so If-Match sits in the call next to the invoice ID.
A 428 that arrives anyway gets an SdkHttpError with statusCode 428, and the SDK doesn’t retry it, since sending the same request again without the header would fail the same way.
import { Acme, SdkHttpError } from "acme-sdk";
const acme = new Acme({ apiKey: process.env.ACME_API_KEY });
try {
await acme.invoices.update({ invoiceId: "inv_123", memo: "Net 30" });
} catch (err) {
if (err instanceof SdkHttpError && err.statusCode === 428) {
// Sent without If-Match. Read the invoice for its ETag, then send it.
}
throw err;
}More on retries and typed errors in SDK error handling.
HTTP 428 questions
Can a 428 apply to a GET?
No, in practice. It protects writes from lost updates, and a read can’t overwrite anything.
Should a 428 say which header is missing?
Yes. Name If-Match in the body and say where to get an ETag, usually the response to a GET on the same URL.
Does If-Unmodified-Since satisfy a 428?
Yes, if your API accepts it. It’s a valid precondition in RFC 9110, though a timestamp has one-second resolution, so ETags are safer for resources that change fast.