HTTP 412 Precondition Failed
Client ErrorA conditional header (If-Match, If-Unmodified-Since…) evaluated to false — the resource changed since the client last saw it.
Defined in RFC 9110
Common causes
- Optimistic locking: ETag in If-Match is stale
- Conditional uploads guarding against overwrites
How to fix it
GET the resource again, take the fresh ETag, reapply changes
Surface a 'document changed elsewhere' flow to end users
Related status codes
The request conflicts with the resource's current state — classic cases are duplicate creation and stale optimistic-locking versions.
304 Not ModifiedThe cached copy the client holds is still valid — the server sends no body. The result of conditional requests with If-None-Match (ETag) or If-Modified-Since.
428 Precondition RequiredThe server requires the request to be conditional — send If-Match/If-Unmodified-Since to avoid lost-update races.
Want to explore status codes interactively? Try the free HTTP Status Code Reference — search, categories and example responses, right in your browser.