409 Conflict
Request cannot be completed due to conflict with resource state.
The request conflicts with the current state of the server.
What HTTP 409 Conflict Means
The request conflicts with the current state of the server.
Request cannot be completed due to conflict with resource state.
Common Causes
- Version conflict
- Duplicate resource creation
- Concurrent modifications
- State mismatch
How to Fix It (For Visitors)
- Refresh the page and try again
- Resolve conflicts
How to Fix It (For Developers/Admins)
- Implement optimistic locking
- Use ETags for version control
- Handle concurrent updates
- Return conflict details in response
Returning a 409 Conflict (Code Examples)
If you build APIs or web apps, here is how to send an HTTP 409 response and how to test for it:
Node.js (Express)
app.get('/resource', (req, res) => {
res.status(409).json({ error: 'Conflict' });
});
Python (Flask)
@app.route('/resource')
def resource():
return jsonify(error='Conflict'), 409
PHP
<?php
http_response_code(409);
header('Content-Type: application/json');
echo json_encode(['error' => 'Conflict']);
Check the status with curl
curl -I https://example.com/resource
# Look for: HTTP/1.1 409 Conflict
Frequently Asked Questions
What does HTTP 409 Conflict mean?
Request cannot be completed due to conflict with resource state. In short: The request conflicts with the current state of the server.
Is 409 Conflict a client or server error?
409 is a 4xx client-error code, so the request itself needs to change. The server is running normally and is rejecting the request as it was sent by the browser, app, or API client.
How do I fix a 409 Conflict error?
Implement optimistic locking. Use ETags for version control. Handle concurrent updates.
Official Specification
The 409 Conflict status code is defined in RFC 7231 Section 6.5.8.