What 412 means
Conditional requests (If-Match, If-Unmodified-Since) use this to prevent lost updates: the resource changed since you last read it.
Common causes
- Your If-Match ETag is outdated because someone else updated the resource.
How to fix it
If you're calling an API
- Fetch the latest version, reapply your change, and send its new ETag.
If you run the server
- Use ETags and 412 for safe concurrent updates.
Should you retry?
After refreshing the resource.
Example response
HTTP/1.1 412 Precondition Failed
Content-Type: application/problem+json
{
"type": "about:blank",
"title": "Precondition Failed",
"status": 412,
"detail": "A condition in the request headers wasn't met."
}Related headers: If-Match, ETag, If-Unmodified-Since.
Defined in: RFC 9110 (HTTP Semantics). 412 is a client error: change the request before retrying.
Debugging an API call? Convert your request with the cURL converter, check the response with the JSON formatter, or see whether the API is down on its status page.