HTTP 201 — Created

The request has been fulfilled, resulting in the creation of a new resource

When to use it

Use status 201 when this is the correct HTTP response semantic: The request has been fulfilled, resulting in the creation of a new resource

Request and response example

POST /users HTTP/1.1
Host: api.example.com
Content-Type: application/json

{"name":"Ada"}

HTTP/1.1 201 Created
Location: /users/42
Content-Type: application/json

{"id":42,"name":"Ada"}

Related status codes

200, 202, 203, 204

References

MDN · RFC 9110