2xx Success

HTTP 201 Created

The request has been fulfilled and a new resource has been created. This is typically the response sent after POST requests or some PUT requests when a new resource is successfully created on the server.

Common Causes

  • New user account successfully registered
  • New record created via API POST request
  • File uploaded and saved on the server

How to Fix

  1. 1No fix needed — the resource was created successfully
  2. 2Check the Location header for the URI of the new resource
  3. 3Verify the response body contains the created resource data

Example

HTTP 201 Created
POST /api/users HTTP/1.1
{ "name": "Bob" }

→ 201 Created
→ Location: /api/users/42

Related Success Codes