HTTP 201 Created
The request has been fulfilled and a new resource has been created.
2xx Success
201
Created
Description
The 201 Created status code indicates that the request has been fulfilled and has resulted in one or more new resources being created. The primary resource created by the request is identified by either a Location header field in the response or, if no Location field is received, by the target URI. The 201 response payload typically describes and links to the resource(s) created. The response should include a Location header with the URI of the newly created resource. The server must create the resource before returning the 201 status code. If the action cannot be carried out immediately, the server should respond with 202 Accepted instead.
When Is It Used?
Returned after a successful POST request that creates a new resource. For example, creating a new user account, adding a new blog post, or uploading a file. The response usually includes the created resource and a Location header.
Example Response
HTTP/1.1 201 Created
Location: /api/users/123
Content-Type: application/json
{"id": 123, "name": "John Doe"}Related Status Codes
200
OK
The request has succeeded.
202
Accepted
The request has been accepted for processing, but the processing has not been completed.
204
No Content
The server has fulfilled the request but there is no content to send in the response body.
409
Conflict
The request conflicts with the current state of the target resource.