@http · HTTP status codes, explained HTTP/1.1 201 Created ━━━━━━━━━━━━━━━━━━━━ 2xx · Success The request succeeded and created a new resource. WHAT IT MEANS ──────────────────────────────────────────────────────────── The request succeeded and created one or more new resources. The Location header should point to the new resource, and the body usually describes it. WHY YOU'RE SEEING IT ───────────────────────────────────────────────────── → A POST to a collection, such as creating a user or an order. → A PUT to a URL where nothing existed yet. HOW TO FIX IT ──────────────────────────────────────────────────────────── → Include Location so clients don't have to guess the new URL. → If the work isn't done yet, return 202 Accepted instead. → If you updated an existing resource, use 200 or 204. EXAMPLE RESPONSE ───────────────────────────────────────────────────────── HTTP/1.1 201 Created Location: /users/42 Content-Type: application/json  {"id": 42, "name": "Ada"} related 200 OK   202 Accepted   409 Conflict spec RFC 9110 §15.3.2 https://www.rfc-editor.org/rfc/rfc9110#section-15.3.2 web https://athttp.com/201 ← curl athttp.com/200 curl athttp.com/202 →