What HTTP 201 means
Return 201 from a POST (or PUT) that creates something, like a new user or order. Include a Location header pointing to the new resource, and usually the created object in the body so the client doesn’t need a second request.
Using 201 correctly
- If creation happens later in the background, return 202 Accepted instead.
Retrying
Not applicable: this isn’t an error.
Example response
HTTP/1.1 201 Created
Date: Wed, 21 Oct 2026 10:30:00 GMT
Location: /users/42
Content-Type: application/json
How to return 201
res.status(201).json(result);
@app.post("/items", status_code=201)
def create_item(item: Item):
return item
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusCreated)
json.NewEncoder(w).Encode(result)
Related status codes
- 200 OK : The request succeeded and the response contains the result.
- 202 Accepted : The request was accepted for processing, but the work isn’t finished yet.
- 409 Conflict : The request conflicts with the current state of the resource.
Other 2xx status codes
200 OK · 202 Accepted · 203 Non-Authoritative Information · 204 No Content · 205 Reset Content · 206 Partial Content · 207 Multi-Status
See the full list of HTTP status codes.
Sources
Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.
Frequently asked questions
What does HTTP 201 Created mean?
HTTP 201 Created means the request succeeded and a new resource was created. Return 201 from a POST (or PUT) that creates something, like a new user or order. Include a Location header pointing to the new resource, and usually the created object in the body so the client doesn’t need a second request.