HTTP 201 Created — What It Means & How to Fix It
Informational2xx success
Overview
The HTTP 201 Created status code indicates the request has been fulfilled and a new resource has been created on the server.
Key Details
- This status code is returned when a POST or PUT request successfully creates a new resource.
- The response should include a Location header pointing to the new resource URL.
- The response body typically contains the representation of the newly created resource.
- It is the preferred response code for successful resource creation in RESTful APIs.
Common Causes
- A POST request successfully created a new resource on the server.
- A PUT request created a resource at the specified URI.
- A user registration, form submission, or data insertion completed successfully.
Steps
- 1Check the Location header in the response for the URL of the new resource.
- 2Verify the response body contains the created resource with its assigned ID.
- 3If you expected 201 but got 200, review the server endpoint implementation.
- 4Use the returned resource data to update your client-side state.
Tags
httpsuccesscreatedrest-api
Related Items
More in 2xx Success
http-200-okHTTP 200 OK — What It Means & How to Fix It
Informationalhttp-202-acceptedHTTP 202 Accepted — What It Means & How to Fix It
Informationalhttp-203-non-authoritative-informationHTTP 203 Non-Authoritative Information — What It Means & How to Fix It
Informationalhttp-204-no-contentHTTP 204 No Content — What It Means & How to Fix It
Informationalhttp-205-reset-contentHTTP 205 Reset Content — What It Means & How to Fix It
Informationalhttp-206-partial-contentHTTP 206 Partial Content — What It Means & How to Fix It
InformationalFrequently Asked Questions
200 OK means a general success, while 201 Created specifically indicates a new resource was created. Use 201 for POST endpoints that create new records.