What 201 Created means
201 Created means the request succeeded and resulted in one or more new resources. The response should include a Location header identifying the new resource, and usually a body describing it.
When a server should return it
- A POST to a collection endpoint created a new item.
- A PUT created a resource at a client-supplied URL that did not exist before.
- An asynchronous job was accepted and a new status resource was created (though 202 is often better).
Example response
http
HTTP/1.1 201 Created
Location: /users/42
Content-Type: application/json
{"id": 42, "name": "Ada"}Why you might see it unexpectedly
- A client retry after a timeout created a duplicate; 201 on the second call is a sign the endpoint is not idempotent.
- A bulk operation returned 201 for every item even when some failed — check for partial-success semantics.
Related status codes
200 OK is the generic success without creation. 202 Accepted is for work that has not completed yet. 409 Conflict is appropriate when uniqueness constraints reject the create.