201 Created

HTTP 201 Created is a 2xx success status. The request succeeded and a new resource was created, usually at the URL in the Location header.

201Status code
2xxSuccess
NoCacheable by default
RFC 9110 §15.3.2Defined in

Common causes

What to do

Return the new resource or its URL so the client does not need a second request.

Example response

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

{"id":42}

Returning 201 in code

Express   res.status(201).json({ … });
Flask     return jsonify(…), 201
PHP       http_response_code(201);
Go        w.WriteHeader(201)

Other 2xx codes

Frequently asked questions

What does HTTP 201 mean?
The request succeeded and a new resource was created, usually at the URL in the Location header.
Is 201 an error?
No. 2xx codes are success responses, not errors.