409 Conflict
The request clashes with the current state of the resource, for example an edit based on a version that has since changed.
At a glance
- Status code
- 409 Conflict
- Class
- 4xx, client error, the request itself is the problem
- Defined in
- RFC 9110
- Cacheable by default
- by explicit headers only
- Response body
- Should describe the conflict well enough for the client to resolve it.
In detail
Unlike most 4xx codes, 409 says the same request might succeed later, once the conflict is resolved. It is a state problem rather than a syntax problem.
Standard for optimistic concurrency, duplicate unique keys, and attempts to delete something that still has children. The body should say which of those it was.
For a version conflict, re-read the resource, merge, and resubmit with the new ETag. Blind retries will hit the same conflict.
Examples
HTTP/1.1 409 Conflict
Content-Type: application/json
{"error":"version_mismatch","current_etag":"\"9a1\""}Things that catch people out
- 412 Precondition Failed is the more precise code when the client sent If-Match and it did not match. Use 409 for conflicts the client did not explicitly guard against.
- A 409 for a duplicate signup leaks that the email address is registered. That is sometimes acceptable and sometimes not.
Try it: HTTP Request Builder
Build a request with any method, headers and body, send it, and read the status line the server returns.
HTTP Request Builder
LOCAL · Browser-OnlyBuild and test HTTP requests with custom headers and body
Authentication
Headers
Generate Code
curl -X GET 'https://api.example.com/endpoint' \
-H 'Content-Type: application/json'Showing a sample URL. Enter your endpoint above to update the snippet.
Related HTTP status codes
All http status codes →412 Precondition Failed
A conditional header on the request, such as If-Match or If-Unmodified-Since, evaluated to false, so the server did not perform the action.
422 Unprocessable Content
The request was well-formed and understood, but the values inside it failed validation. The syntax was fine and the semantics were not.
423 Locked
The resource is locked by WebDAV and cannot be modified until the lock is released or a valid lock token is supplied.
410 Gone
The resource existed and has been permanently removed with no forwarding address. Stronger and more useful than 404 when you know the removal is final.
411 Length Required
The server refuses the request because it did not include a Content-Length header.
413 Content Too Large
The request body is larger than the server is willing to process. Formerly called Payload Too Large.
Tools for this
- HTTP Request Builder Free online HTTP request builder - build and test HTTP requests with custom headers and body
- HTTP Headers Checker Free online HTTP headers checker - view HTTP response headers for any URL