201 Created

The request created a resource. The response should include a Location header pointing at the new resource's URL, and conventionally the body carries its representation. It is the correct success code for POST-that-creates and for PUT to a new URL.

What usually causes it

  • Successful resource creation via POST or PUT

How to debug and fix it

  1. If your API returns 200 for creations, switch to 201 + Location — clients and SDK generators rely on it.
  2. If a client can't find the created resource, check the Location header value (relative vs absolute URL bugs are common).
  3. For idempotent creates (PUT with a client-chosen ID), return 201 on first create, 200 or 204 on subsequent identical calls.

Easily confused with