Skip to content

2xx Success

201 Created

The request succeeded and created a new resource.

What 201 means

Typical response to a POST that creates something. The Location header usually points to the new resource.

Common causes

  • A POST or PUT created a resource.

How to fix it

If you're calling an API

  • Read the Location header or response body for the new resource's ID.

If you run the server

  • Return the new resource (or its URL in Location) so clients don't need a second request.

Should you retry?

Don't retry: a retry may create a duplicate. Use idempotency keys where the API supports them.

Example response

HTTP
HTTP/1.1 201 Created
Location: /v1/items/42
Content-Type: application/json

{"id": 42, "name": "New item"}

Related headers: Location.

Defined in: RFC 9110 (HTTP Semantics). 201 is a success.

HTTP 201 FAQ

What does HTTP 201 mean?

201 Created: The request succeeded and created a new resource. Typical response to a POST that creates something. The Location header usually points to the new resource.

Is 201 a client or server error?

Neither: 201 is a success response (2xx). The request was received, understood and accepted.

How do I fix a 201 error?

Read the Location header or response body for the new resource's ID.

Should I retry after a 201?

Don't retry: a retry may create a duplicate. Use idempotency keys where the API supports them.

Other 2xx status codes

All HTTP status codes