412 Precondition Failed

HTTP 412 Precondition Failed is a 4xx client error status. A condition in the request headers, such as If-Match, evaluated to false.

412Status code
4xxClient error
NoCacheable by default
RFC 9110 §15.5.13Defined in

Common causes

What to do

Re-fetch the resource to get the current ETag, then retry.

Example response

HTTP/1.1 412 Precondition Failed
Content-Type: application/problem+json

{"status":412,"title":"Precondition Failed"}

Returning 412 in code

Express   res.status(412).json({ … });
Flask     return jsonify(…), 412
PHP       http_response_code(412);
Go        w.WriteHeader(412)
nginx     return 412;

Other 4xx codes

Frequently asked questions

What does HTTP 412 mean?
A condition in the request headers, such as If-Match, evaluated to false.
Is 412 an error?
Yes. It is a client error: the request needs to change before retrying.
Does a 412 hurt SEO?
If search engines see it repeatedly on pages that should rank, those pages can be dropped from the index. Fix it quickly.