DevToolPal
EN
4xx Client errors

412 Precondition Failed

What it means

A precondition in the request headers, such as If-Match or If-Unmodified-Since, evaluated to false, so the server did not apply the request.

Common causes

  • Someone else updated the resource (ETag changed)
  • Stale cached ETag used in If-Match
  • Conditional upload to storage that already has a newer object

How to fix it

As a client or visitor

GET the resource again to get the current ETag, reapply your changes, and resend.

As the site or API owner

Return the current ETag and make conditional checks atomic with the write.

Example response

HTTP/1.1
HTTP/1.1 412 Precondition Failed
Date: Tue, 07 Oct 2025 09:30:00 GMT
Server: nginx
ETag: "v8"
Content-Type: application/problem+json

{
  "type": "about:blank",
  "title": "Precondition Failed",
  "status": 412,
  "detail": "If-Match \"v7\" does not match the current version \"v8\"."
}

Specification

RFC 9110 §15.5.13

FAQ

› What is optimistic concurrency control?

Clients send If-Match with the ETag they read; the server rejects the write with 412 if the resource changed in the meantime.

› 412 vs 428?

412: your precondition failed. 428: you must send a precondition at all.