Back to Status Codes
Successful (2xx)

HTTP 201 Created

The request was successful and a new resource was created as a result.

201

Created

The request was successful and a new resource was created as a result.

What Causes HTTP 201?

  • POST request created a new resource successfully
  • PUT request created a new resource at the specified URI
  • New user account, order, or record was created

Code Examples

See how HTTP 201 responses look in different programming languages and tools.

curl -X POST https://api.example.com/users \
  -H "Content-Type: application/json" \
  -d '{"name":"John"}'
# Response: 201 Created

How to Fix HTTP 201

  • Extract the resource ID from the Location header
  • Use the returned resource ID for subsequent operations
  • Verify the resource was created by fetching it with GET

Related Status Codes

Test Your APIs

Frequently Asked Questions

What does HTTP 201 mean?

The request was successful and a new resource was created as a result.

What causes HTTP 201?

POST request created a new resource successfully. PUT request created a new resource at the specified URI. New user account, order, or record was created

How to fix HTTP 201?

Extract the resource ID from the Location header. Use the returned resource ID for subsequent operations. Verify the resource was created by fetching it with GET

http 201created errorhttp status codesapi error handlingrest api successful