tool::http-status-detail
201 Created
The request has been fulfilled and a new resource has been created.
Status Code
201
Name
Created
Category
2xxDetailed Explanation
HTTP 201 Created indicates that the request was successful and a new resource was created as a result. It should be used instead of 200 OK when a POST request creates a new user, post, order, or any other resource. REST API best practice is to include the URL of the newly created resource in the Location header.
Common Causes
- ▸A POST request successfully created a new database record
- ▸A file upload succeeded and a new file resource was created
- ▸User registration, post creation, order placement, or other item-creation operations
- ▸A PUT request created a resource that did not previously exist
How to Fix
- 1.201 is a normal response — no fix needed
- 2.Include a Location header pointing to the newly created resource URL
- 3.Consider including the full created resource data in the response body
- 4.Use 200 OK for successful read operations, not resource creation
Related HTTP Headers
LocationContent-TypeETagResponse Example
HTTP/1.1 201 Created
Location: /api/users/42
Content-Type: application/json
{"id":42,"name":"Jane Doe","email":"jane@example.com"}Related Status Codes
200OKThe request has succeeded.→202AcceptedThe request has been accepted but not yet acted upon.→203Non-Authoritative InformationThe response is from a transforming proxy, not the origin server.→204No ContentThe server successfully processed the request but returns no content.→205Reset ContentThe server processed the request; the client should reset the document view.→
ad · 300×250
// related tools