When you see this status
- Updating a resource with stale data (e.g., version mismatch)
- Creating a duplicate resource with unique constraints
- Concurrent modifications causing inconsistency
- Race conditions in distributed systems
Common causes
- Optimistic locking failures (e.g., ETag/version mismatch)
- Unique constraint violations in databases
- Inconsistent state due to concurrent requests
- Business rule violations (e.g., invalid state transition)
How to debug it
- Check request payload for conflicts with existing state
- Verify resource version/ETag headers if applicable
- Inspect server logs for concurrent modification traces
- Validate business logic constraints before processing
Return this code in your framework
Express (Node.js)
res.status(409).json({ error: 'Conflict', message: 'Resource version mismatch' });
FastAPI (Python)
return JSONResponse(status_code=409, content={"detail": "Conflict: version mismatch"})
NestJS
@HttpCode(409) @Post() async create(@Body() dto: CreateDto) { throw new ConflictException('Duplicate entry'); }
Go (net/http)
w.WriteHeader(http.StatusConflict); w.Write([]byte(`{"error":"Conflict"}`))
About HTTP 409
HTTP status code 409 Conflict is part of the
4xx Client Error family. Request conflicts with current server state; cannot be completed. Understanding it is essential for
backend engineers, API designers, and anyone debugging integrations between services.
The Qaynaq Labs HTTP Status Code Explainer covers all standard codes with practical guidance:
what triggers them, how to debug them in production, and exactly how to return them from common
frameworks. Each code page is hand-curated and verified.