409 🌐 HTTP

HTTP 409 Conflict

The request conflicts with the current state of the resource — e.g. a duplicate or an edit based on an outdated version.

Seen on: REST API Git

Meaning

APIs return 409 for duplicates (“username already taken”), optimistic-locking failures (someone else changed the record first) and invalid state transitions (cancelling an already-shipped order).

Common causes

  • Creating a resource that already exists (unique constraint)
  • Version/ETag mismatch — the resource changed since you read it
  • Invalid state transition
  • Concurrent writes to the same resource

⚡ Quick fix

  1. Read the response body for the conflicting field or state
  2. Re-fetch the latest version, re-apply the change and retry
  3. Use idempotency keys for create operations that may be retried

Detailed fix by platform

REST API

  1. Send If-Match: <etag> on updates and handle 409/412 by refreshing and merging.

Git

  1. Git hosting APIs return 409 for e.g. creating a branch that exists or merging with conflicts.

How to diagnose

  1. State — What is the current server state of the resource?
  2. Concurrency — Did another client modify it?
  3. Uniqueness — Does an equivalent resource already exist?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.