201 Created

Success - A new resource was created

HTTP 201 Created

What It Means

The HTTP 201 Created status code indicates that the request has been fulfilled and a new resource has been created. This is the standard response for successful POST requests that create new entities.

When to Use 201

  • After a successful POST request that creates a new resource
  • When a PUT request creates a resource at a specific URL that didn't exist
  • Creating users, orders, posts, or any new entity in your API

Required Headers

Location Header

The 201 response should include a Location header pointing to the newly created resource:

Location: /api/users/456

Example Response

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

{
  "id": 456,
  "email": "[email protected]",
  "created_at": "2025-01-15T10:30:00Z"
}

201 vs 200

Scenario Use
POST creates new user 201
PUT updates existing user 200
POST adds item to cart 201
POST submits form (no new resource) 200

Best Practices

  • Always include the Location header
  • Return the created resource in the response body
  • Include the generated ID and timestamps
  • Don't use 201 for actions that don't create persistent resources

Frequently Asked Questions

What does HTTP 201 Created mean?
HTTP 201 Created indicates that the request has been fulfilled and a new resource has been created as a result. It is the standard response for successful POST requests that create new entities like users, orders, or records.
What headers should a 201 response include?
A 201 response should include a Location header pointing to the newly created resource's URL (e.g., Location: /api/users/456). The response body should contain the created resource with its generated ID and timestamps.
When should I use 201 vs 200?
Use 201 when a POST request creates a new persistent resource (new user, new order). Use 200 when a POST performs an action that does not create a new resource, like submitting a login form or running a search query.
Can a PUT request return 201?
Yes. If a PUT request creates a resource at a specific URL that did not previously exist, returning 201 Created is appropriate. If the PUT updates an existing resource, return 200 OK instead.
How does monitoring detect creation failures?
UptimeSignal can monitor your POST endpoints by sending test requests and verifying the expected 201 status code. If your creation endpoints start failing or returning errors, you get alerted immediately.

Monitor your API creation endpoints

Ensure your POST endpoints return correct status codes.

Start monitoring free →

Related Status Codes

More Resources