Skip to the content

409 Conflict

The request clashes with the current state of the resource: someone else changed it first, or what you want to create is already there.

Class
4xx Client error. The request is the problem: a wrong address, missing credentials, data the server can't accept.
Defined in
RFC 9110

Share this tool:TwitterFacebookLinkedInWhatsAppEmail

What causes it

For a change that can't be combined with what the server holds now. Two people edit the same record and the second save is based on an old version. A user name is taken. A folder isn't empty and so can't be deleted. An order was already cancelled.

What to do about it

Fetch the current state, sort out the difference and send the request again. An API should say in the body what the conflict is.

If the request was a second attempt at something that did go through the first time, the 409 tells you so. Check before you create a duplicate.

If you build the API: 409 is for conflicts the user can resolve. Data that breaks a rule on its own is a 422.

Not to be confused with

412 Precondition FailedThe conflict was caught by a condition the client sent along, such as If-Match.
422 Unprocessable ContentThe data is invalid in itself, whatever the state of the resource.
423 LockedThe resource is locked.

All codes are on the list of HTTP status codes, which can be searched by number and by word.

See all 12