HTTP 201 — Created
HTTP 201
Created
The request succeeded and a new resource was created as a result.
What 201 actually means
The correct answer to a POST or PUT that brought something new into existence — a new user, a new order, a new file. The response should carry a `Location` header pointing at the thing that was created, and usually a body describing it. Using 200 here instead is common and harmless in practice, but 201 tells the client something useful that 200 does not.
Common causes
- A POST to a collection endpoint created a new record
- A PUT to a URL that did not previously exist created the resource there
If you're just trying to view the page
- Nothing — whatever you submitted was saved
- If the page did not update to show the new item, that is a front-end bug; reload to see it
If it's your site
- Include a `Location` header with the URL of the new resource; clients and API tooling rely on it
- If creation is asynchronous and the resource does not exist yet, return 202 instead — 201 promises the thing is there now
- Make creation idempotent where you can, so a retried request does not create duplicates
Reference
- Status code
- 201
- Reason phrase
- Created
- Category
- 2xx — Success
- Defined in
- RFC 9110 §15.3.2
Common questions
- What does HTTP 201 mean?
- The request succeeded and a new resource was created as a result. The correct answer to a POST or PUT that brought something new into existence — a new user, a new order, a new file. The response should carry a `Location` header pointing at the thing that was created, and usually a body describing it.
- How do I fix a 201 error?
- Nothing — whatever you submitted was saved
- Is 201 a client error or a server error?
- 201 is in the 2xx range, which means success. It is not an error at all.
Related pages
- 200 OK The request worked and the response contains what was asked for.
- 204 No Content The request succeeded and there is deliberately no body to send back.
- 206 Partial Content The server is returning only the requested byte range of a file, not the whole t
- 202 Accepted The request was accepted for processing, but the work has not finished yet.
- 207 Multi-Status A WebDAV response carrying separate status codes for several resources at once.
- 203 Non-Authoritative Information The request succeeded, but an intermediary modified the response on the way.
- 205 Reset Content The request succeeded and the client should clear the form that sent it.
- 208 Already Reported Inside a WebDAV multi-status response, this member was already listed earlier so
- 226 IM Used The server is returning a delta against a copy the client already has, rather th