HTTP status · 2xx — success

201 Created

201 Created means the request succeeded and a new resource was created, usually identified by a Location header.

Key facts

Class2xx — success
StandardRFC 9110 §15.3.2
Cacheable by defaultNo
Key headerLocation
Typical methodsPOST, PUT

What 201 means

The server created a new resource as a result of the request. The response body may describe it, and the Location header should give its URI. A client can then GET that URI to read the new resource. 201 is the precise answer for a successful create; 200 is too vague when the creation has a distinct address.

Location header rules

Location may be an absolute URL or a path relative to the request URI. It must identify the created resource, not a documentation page. APIs that return the new object in the body usually also set Location so clients that only follow headers still work. If no resource was created, do not use 201 — return 200 or 204 instead.

Frequently asked questions

Does 201 need a response body?

No. The body is optional; the status and Location header already communicate the result.

What is the difference between 200 and 201?

200 says the request succeeded. 201 says it succeeded by creating a new resource, which should be identified in the Location header.

New tools, straight to your inbox

One short email when we add tools worth using. No spam, unsubscribe anytime.