Error Codes Wiki

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

  1. 1Check the Location header in the response for the URL of the new resource.
  2. 2Verify the response body contains the created resource with its assigned ID.
  3. 3If you expected 201 but got 200, review the server endpoint implementation.
  4. 4Use the returned resource data to update your client-side state.

Tags

httpsuccesscreatedrest-api

Related Items

More in 2xx Success

Frequently 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.