201 Created
The request succeeded and created a new resource, usually identified by a Location header.
| Class | Success (2xx) |
|---|---|
| Defined in | RFC9110, Section 15.3.2 |
| Cacheable by default | No, unless explicit freshness headers allow it |
Common causes
- A POST created a new record, such as a user, order or file.
- A PUT created a resource that did not exist.
What to do
Return a Location header with the new resource's URL and, if useful, a representation of it in the body.
Related codes
- 200 OK: The request succeeded. What the body contains depends on the method used.
- 202 Accepted: The request was accepted for processing, but the processing is not finished.
- 204 No Content: The request succeeded and there is no body to send back.