Skip to main content
apiguide.dev

HTTP 412 — Precondition Failed

One or more preconditions in the request headers evaluated to false.

Status CodeHTTP 412
CategoryClient Error (4xx)
API Error Subtypes1 error schema
HTTP Headers4 headers

What does HTTP status code 412 mean?

The 412 Precondition Failed status code indicates that one or more conditional checks specified in the client’s request headers (like If-Match) failed.

When to use it in APIs

Used in conditional updates. A client submits a PUT request with If-Match: "etag_value". If the resource ETag has changed on the server, the server returns 412 to prevent the client from overwriting concurrent changes.

How it compares to other codes

  • 409 Conflict: A general state conflict. 412 is strictly tied to HTTP headers-based optimistic concurrency control.

Specific API Error Types for 412

Associated HTTP Headers

Related HTTP Status Codes