412 Precondition Failed

An If-* header condition didn't hold.

4xx · Client error

What it means

A condition in the request headers, such as If-Match or If-Unmodified-Since, didn't hold, so the server didn't apply the change.

This is how HTTP prevents lost updates: the edit only applies if nobody changed the resource since you read it.

Why you're seeing it

  • Someone else updated the resource after you fetched it, so its ETag changed.
  • Sending a stale ETag from an old cache.

How to fix it

  • Fetch the current version, merge your changes and retry with the new ETag.

Example response

HTTP/1.1 412 Precondition Failed
ETag: "v8"
Content-Type: application/json

{"error": "resource changed; reload and retry"}