HTTP 409 Conflict
The request conflicts with the current state of the target resource.
4xx Client Error
409
Conflict
Description
The 409 Conflict status code indicates that the request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request. The server should generate a payload that includes enough information for a user to recognize the source of the conflict. Conflicts are most likely to occur in response to a PUT request. For example, if versioning were being used and the representation being PUT included changes to a resource that conflict with those made by an earlier (third-party) request, the origin server might use a 409 response to indicate that it can't complete the request.
When Is It Used?
Returned when a request conflicts with the current state of a resource. Common examples include trying to create a resource that already exists (duplicate username/email), editing a resource that has been modified by another user since it was loaded (optimistic locking), or version conflicts.
Example Response
HTTP/1.1 409 Conflict
Content-Type: application/json
{"error": "conflict", "message": "A user with this email already exists"}