At One Place

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

  1. Nothing — whatever you submitted was saved
  2. 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

  1. Include a `Location` header with the URL of the new resource; clients and API tooling rely on it
  2. If creation is asynchronous and the resource does not exist yet, return 202 instead — 201 promises the thing is there now
  3. 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

Sources

  1. Hypertext Transfer Protocol (HTTP) Status Code Registry — IANA
  2. RFC 9110: HTTP Semantics — IETF

How these figures are compiled and checked