What does HTTP 201 mean?
The request succeeded and a new resource was created. REST APIs return 201 after a successful POST (or PUT that creates something). The response should include a Location header with the URL of the new resource, and often the resource itself in the body.
2xx Success: The request was received, understood and accepted.
201 and SEO
Not relevant for web pages; used by APIs.
Example response
HTTP/1.1 201 Created
Location: /api/users/42
Content-Type: application/json
How to return a 201 response
Node.js (Express)
res.status(201).json({ error: 'Created' });PHP
http_response_code(201);Python (Flask)
return {'error': 'Created'}, 201Go (net/http)
w.WriteHeader(201)nginx
return 201;
Related status codes
- 200 OK — The request succeeded and the response body contains the requested resource.
- 202 Accepted — The request was accepted for processing, but processing has not finished.
- 204 No Content — The request succeeded and there is no response body.
- 409 Conflict — The request conflicts with the current state of the resource.
Check which status code a URL returns with the HTTP header checker.