A precondition in the request headers (If-Match, If-Unmodified-Since, If-None-Match) was false.
412 Precondition Failed means the server evaluated a conditional header on a state-changing request and it did not hold. It is how optimistic concurrency works: "update only if the ETag is still X". If someone else changed the resource first, the update is rejected instead of silently overwriting their change.
If-Match with an outdated ETag on PUT, PATCH or DELETE.If-None-Match: * on PutObject when the key already exists.ifGenerationMatch.| Header | Role |
|---|---|
If-Match | Request precondition on the ETag. |
If-Unmodified-Since | Date-based precondition. |
ETag | Current version. |
HTTP/1.1 412 Precondition Failed
ETag: "v42"
Content-Type: application/json
{"error": "Resource was modified (current ETag v42)"}