More
More
409 Conflict
The request conflicts with the current state of the resource.
- Code
409- Reason phrase
- Conflict
- Class
- 4xx Client error
- Defined in
- RFC 9110 section 15.5.10
- Cacheable by default
- No
What it means
Client error: the problem lies with the request. Repeating it unchanged will normally fail again.
When a server should send it. When the request conflicts with the current state of the resource: an edit based on an old version, a duplicate unique key, a folder that already exists. Explain the conflict in the body so the client can resolve it.
Common causes. Editing a record someone else changed, creating something that already exists, or a version mismatch.
What to do. Reload the latest version, merge your change and try again.
How clients and crawlers treat it
Browsers and HTTP clients. Browsers show the body. API clients usually fetch the latest state, merge and retry, which the server cannot do for them.
Google Search. Like every 4xx except 429, it tells Google the content does not exist: an indexed URL is removed from the index, and a new one is not processed. Crawl frequency for the URL gradually drops. Source: Google Search Central, How HTTP status codes, and network and DNS errors affect Google Search.
Caching. Not cacheable by default (RFC 9110 section 15.1 does not list it). A cache stores it only when the response says so with Cache-Control or Expires.
Example response
HTTP/1.1 409 Conflict Content-Type: text/plain; charset=utf-8 Conflict
How to send 409
location /example {
return 409;
}
RewriteEngine On RewriteRule ^example$ - [R=409,L]
http_response_code(409); echo 'Conflict'; exit;
res.writeHead(409, { 'Content-Type': 'text/plain' });
res.end('Conflict');
# in a view function return 'Conflict', 409
Change the paths to suit. In nginx, add_header needs always to apply to error responses.
Related codes
- 412Precondition FailedA condition in the request headers, such as If-Match, was not met.
- 422Unprocessable ContentThe request is well formed but its data fails validation.
- 428Precondition RequiredThe server requires the request to be conditional, such as with If-Match.
All status codes · All 4xx codes
Names and numbers from the IANA HTTP Status Code Registry. Google Search behaviour as documented by Google Search Central.