Error Codes Wiki

HTTP 409 Conflict — Resolving Resource State Conflicts

Warning4xx client error

Overview

HTTP 409 Conflict indicates the request conflicts with the current state of the server resource, common in concurrent editing and version control scenarios.

Key Details

  • 409 signals that the request cannot be completed due to a conflict with the resource's state
  • Common in RESTful APIs when two clients try to modify the same resource simultaneously
  • Often used with ETags and If-Match headers for optimistic concurrency control
  • The response body should describe the conflict so the client can resolve it
  • Different from 412 Precondition Failed which is about conditional request headers

Common Causes

  • Two users editing the same document simultaneously (edit conflict)
  • Trying to create a resource that already exists (duplicate key)
  • Version mismatch — client has stale data and tries to update
  • Database unique constraint violation surfaced through the API
  • Git-like merge conflict in collaborative editing systems

Steps

  1. 1Read the response body for details about what conflict occurred
  2. 2Fetch the latest version of the resource with a fresh GET request
  3. 3Merge your changes with the current state and retry the request
  4. 4Use If-Match with ETag headers for optimistic concurrency control
  5. 5Implement retry logic with exponential backoff for automated systems

Tags

http409conflictconcurrencyrest-api

More in 4xx Client Error

Frequently Asked Questions

Use 409 when the request is valid but conflicts with server state. Use 400 when the request itself is malformed.