201 HTTP Origin: Network OSI layer 7 · Application Last updated 18 Nov 2026

HTTP 201 Created

The request succeeded and a new resource was created, normally returned after POST or PUT.

Exact message you may see HTTP 201 CreatedHTTP/1.1 201 Createdstatus 201 created201 Created Location header
Seen on: HTTP REST API

Meaning

A well-formed 201 includes a Location header with the new resource URL and often the created representation in the body. Clients that expect 200 sometimes treat 201 as an error; check response.ok (any 2xx) instead of === 200.

Common causes

  • Normal result of a successful create
  • Client code only accepts status 200
  • Missing Location header
  • Duplicate POST creating two resources on retry
  • API returns 201 for an update

⚡ Quick fix

  1. Treat any 2xx as success (response.ok)
  2. Return a Location header with 201
  3. Use idempotency keys to stop duplicate creates

Detailed fix by platform

JavaScript

  1. javascript
    const res = await fetch("/api/items", { method: "POST", body: JSON.stringify(item) });
    if (res.status === 201) console.log(res.headers.get("Location"));

How to diagnose

  1. Location header — Present?
  2. Client — Accepts 2xx?
  3. Retry — Creates duplicates?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

#fragment — The #fragment part of the URL never reaches the server (hash/anchor ignored in logs and redirects) (HTTP)#fragment+ vs %20 — Query string space encoded as + vs %20 (wrong values, 404 or signature mismatch) (HTTP)+ vs %20102 — HTTP 102 Processing (HTTP)102200 — HTTP 200 OK (but something is still wrong) (HTTP)200200 — API returns 200 OK with an error in the body (errors hidden from clients and monitors) (HTTP)200202 — HTTP 202 Accepted (HTTP)202203 — HTTP 203 Non-Authoritative Information (HTTP)203204 — HTTP 204 No Content (HTTP)204201

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.