I am a little puzzled by the other answers, as some of them are almost right. So, let a little clarify the situation. If all requests are actually executed using the POST method, in the context of ReSTfulness, they must modify the state on the target server. Otherwise, the POST value is a little relaxed, as you can see in RFC 7231, p. 4.3.3 .
Since the purpose of the requests is to create a new version of the resource, they failed if a version with this presentation already exists. This will disqualify any 2xx class response codes. From section 6.3 :
The 2xx code class (successful) indicates that the client request was successfully accepted, understood, and accepted.
If you absolutely wanted this, you could go for 202 / Accepted , which is "intentionally evasive." This is a bit stretched since this status code is meant to be processed in a queue. I would advise doing this.
The 204 / No Content code suggested by others is a bit of a bad choice. This was absolutely correct if you POST ed to the resource you were updating.
As a result, there is neither an informational (1xx), nor a server error (5xx). Let's look at the 3xx class first. From section 6.4 :
The 3xx status class (redirect) status indicates that the user agent must take additional steps to complete the request.
One of the most famous here will be 304 / Not Modified . Although this code seems to fit perfectly, this code, unfortunately, is not applicable here. It can only be returned in response to conditional GET or HEAD requests.
302 / Found might seem like the next one. However, this code is for temporary redirects, which is most likely not what you need.
As suggested here, 303 / See Other is a really good choice:
The status code 303 (see another) indicates that the server redirects the user agent to another resource [...], which is designed to provide an indirect response to the original request. [...] This status code applies to any HTTP method. It is mainly used to allow the output of a POST action to redirect a user agent to a selected resource.
All other 3xx codes deal with various forms of redirects that are unlikely to be related to the situation here.
Final view, status code 4xx. From RFC 7231, sec. 6.5 :
The 4xx error code class (Client Error) indicates that the client seems to be mistaken. Unless it responds to a HEAD request, the server MUST send a view containing an explanation of the error situation, and whether this is a temporary or permanent condition. These status codes apply to any request method.
Very few of them are really divided into the request body. Two of those who did this stand out here: “ 400 / Bad Request , which is too wide in design. It is - if you want - a solution for everyone. However, this will mean that the request body is incorrectly distorted (as in syntactically incorrect), which probably not so.
More interesting is 409 / Conflict . From the RFC (focus):
Status code 409 (conflict) indicates that the request cannot be completed due to a conflict with the current state of the target resource .
The definition wording puts this code in accordance with the PUT method, but is no exception. Repeat the 4xx code definition:
These status codes apply to any request method.
422 / Unprocessable Entity is a contender, but implies a semantic error, which is actually not the case here.
Ultimately (the drumroll), the last piece of the puzzle can be found in section 4.3.3 :
If the result of the POST processing is equivalent to representing an existing resource, the source server MAY redirect the user agent to this resource by sending a 303 response (see the "Other" section) with the existing resource identifier in the "Location" field.
Pay attention to "MAY". So you can choose between 303 and 409. I think 409 is better suited, since a clearly earlier request presented a state that is incompatible with the current one. OTOH, 303 may be a political way to go closer to the standard. In any case, as a consumer of your API, I would really like to know if my requests have worked. And be it without any effect.