201
HTTP Web Protocol
Severity: MinorWhat Does This Error Mean?
HTTP 201 Created means the request succeeded and a new resource was created on the server as a result. You typically see 201 after submitting a registration form, creating an account, or posting data to an API. 201 is a success code — it is not an error and does not require any action from the user.
Affected Models
- All web browsers
- All web servers
- REST APIs
- Mobile apps
- Desktop applications
Common Causes
- A new user account was successfully registered
- An API POST request successfully created a new record or resource
- A file was successfully uploaded to a server
- A new blog post, comment, or content item was published
- A shopping cart item or order was successfully created
How to Fix It
-
If you are a regular user and your action completed successfully, a 201 response means it worked — nothing further is needed.
You would typically see this reflected in the app as a success message, not as a raw 201 code.
-
If you are a developer, return 201 Created (not 200 OK) when a POST request results in a new resource being created.
This distinction matters for API clients that need to know when to update their local state.
-
Include a Location header in the 201 response pointing to the URL of the newly created resource.
Example: Location: /api/users/12345 — this allows the client to immediately retrieve the new resource.
-
Optionally include the created resource in the response body to save the client an extra GET request.
Most modern APIs return the full created object in the 201 response body for efficiency.
-
If an API is returning 200 for resource creation instead of 201, update the server response code.
Returning 200 instead of 201 is technically wrong per the HTTP specification and can confuse API clients.
-
For idempotent requests (where creating the same resource twice should not create duplicates), consider using 200 or 303 See Other instead of 201.
201 implies a new resource was created — if the resource already existed, use a different status code.
When to Call a Professional
HTTP 201 is a success response — no professional help is needed for regular users. Developers should use 201 instead of 200 when a POST request creates a new resource — this follows REST API best practices. The response should include a Location header pointing to the newly created resource's URL.
Frequently Asked Questions
What is the difference between HTTP 200 and HTTP 201?
HTTP 200 OK is a general success — the request was processed and data was returned. HTTP 201 Created is specifically for requests that resulted in a new resource being created. For REST APIs, 201 is the correct response for successful POST requests that create new records.
Should a 201 response always include the new resource?
It is best practice to include the new resource in the response body, but it is not required. Including the created object saves the client an extra GET request to fetch it. At minimum, include a Location header so the client knows where to find the new resource.
Can HTTP 201 be returned for GET requests?
Technically no — GET requests retrieve data and should return 200 OK if successful. 201 Created is semantically reserved for requests that create new resources, such as POST or PUT. Returning 201 for a GET request would be misleading and incorrect.