Back to all status codes

201

Created

Success
RFC 7231

The request has been fulfilled and resulted in a new resource being created.

Detailed Information

The 201 status code indicates that the request has been fulfilled and has resulted in one or more new resources being created. The primary resource created by the request is identified by either a Location header field in the response or, if no Location field is received, by the effective request URI.

Common Examples

  • Creating a new user account
  • Uploading a new file
  • Adding a new blog post

Common Uses

  • POST requests creating new resources
  • User registration endpoints
  • File upload systems

Best Practices

  • Include Location header with URI of new resource
  • Return representation of created resource
  • Use appropriate response body structure

Additional Resources

Read more on MDN