409 Conflict means: The request conflicts with the current state of the target resource. The conflict is usually resolvable by the client: edit collisions, duplicate unique keys, or state-machine violations (e.g. cancelling an already-shipped order). Client-error 4xx codes mean the request itself is the problem: malformed syntax, missing credentials, forbidden access, a nonexistent resource or a violated precondition. The server is telling the client what to change; retrying the identical request without a fix will reproduce the same error. In practice you will meet 409 when a unique constraint violation (duplicate email, slug or idempotency key reuse with different payload); optimistic-locking failure: the resource changed since the client read it; an operation invalid in the resource's current state (delete a locked account). On the client side, re-read the current state, merge or adjust the request, and retry; for version conflicts use If-Match ETags to detect them explicitly. On the server side, describe the conflict precisely in the body (which field, which state); use 409 for state conflicts rather than overloading 400.
When 409 happens
- A unique constraint violation (duplicate email, slug or idempotency key reuse with different payload)
- Optimistic-locking failure: the resource changed since the client read it
- An operation invalid in the resource's current state (delete a locked account)
How to fix it
On the client
Re-read the current state, merge or adjust the request, and retry; for version conflicts use If-Match ETags to detect them explicitly.
On the server
Describe the conflict precisely in the body (which field, which state); use 409 for state conflicts rather than overloading 400.
Should you retry?
Not retryable as-is: change the request (credentials, payload, URL) first.
Debugging steps
When 409 appears unexpectedly, start by capturing the full exchange: 'curl -i' or the browser DevTools Network tab shows the exact status line and response headers, which often carry the real explanation. Read the error body first — well-designed APIs name the offending field or missing credential. Then diff your actual request, headers included, against the documented contract. For this code specifically, check whether the most common trigger applies to your situation: a unique constraint violation (duplicate email, slug or idempotency key reuse with different payload). Compare your exchange against the raw HTTP example above. If you operate the server, correlate the timestamp with application and proxy logs using the request id; if you are the client, verify the request shape against the API documentation before changing anything or retrying.
Notes & gotchas
A good 409 body names the conflicting field or state and suggests the resolution path; 'conflict' alone forces clients to re-read everything and guess what changed.
Examples
HTTP/1.1 409 Conflict
Content-Type: application/json
Content-Length: 143
{
"error": "conflict",
"message": "A unique constraint violation (duplicate email, slug or idempotency key reuse with different payload)"
} curl -i https://api.example.com/v1/resource # observe the 409 response and its headers const res = await fetch("https://api.example.com/v1/resource");
if (res.status === 409) {
const problem = await res.json(); // read field-level details
// fix the request (credentials, payload, URL) — identical retries keep failing
throw new RequestError(problem);
} import requests
res = requests.get("https://api.example.com/v1/resource", timeout=10)
if res.status_code == 409:
problem = res.json() # field-level error details
# correct the request before retrying — identical retries keep failing
raise RequestProblem(problem) Frequently asked questions
409 vs 412: both are conflicts?
412 is specifically a failed conditional header (If-Match/If-Unmodified-Since). 409 is a broader state conflict the client can often resolve by re-reading and merging.
Should duplicate signup return 409?
Commonly yes — 'email already registered' is a state conflict. Some APIs prefer 422 with a field error; consistency within your API matters most.
Are 4xx errors always the client's fault?
By contract yes — the server asserts the request must change. In practice servers sometimes misuse 4xx for their own problems (e.g. 400 for internal validation bugs), so read the error body before blaming your client code.
Should I retry 4xx responses automatically?
Generally no: the server says the request must change. Exceptions are 408 (fresh connection), 425 (after handshake) and 429 (after Retry-After). Blind retries of 400/401/403/404 just burn quota.
Try the JSON Validator
Check JSON syntax and locate errors by line and column.