Skip to content

4xx Client error

412 Precondition Failed

A condition in the request headers wasn't met.

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
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.

HTTP 412 FAQ

What does HTTP 412 mean?

412 Precondition Failed: A condition in the request headers wasn't met. Conditional requests (If-Match, If-Unmodified-Since) use this to prevent lost updates: the resource changed since you last read it.

Is 412 a client or server error?

It's a client error (4xx): something about the request needs to change before it can succeed.

How do I fix a 412 error?

Fetch the latest version, reapply your change, and send its new ETag.

Should I retry after a 412?

After refreshing the resource.

Other 4xx status codes

All HTTP status codes