Start free · Free tools · Fair usage limits
Browse Tools

Categories

Custom AI Solutions – AI2Flows
LIVE NEWS
Loading latest AI & SEO news…
Home›Tools›HTTP Status Codes Reference›HTTP 201 Created
2xx Success

HTTP 201 Created

HTTP 201 Created means the request succeeded and a new resource was created as a result. It is the standard response to a POST (or PUT) that creates…

Quick answer

HTTP 201 Created means the request succeeded and a new resource was created as a result. It is the standard response to a POST (or PUT) that creates something, and it should include a Location header pointing to the new resource’s URL.

Last updated · Maintained by FreeAIToolz · How we test

What does HTTP 201 Created mean?

Use 201 when the server has actually created the resource before responding. If creation will happen later (a queued job), 202 Accepted is the correct code instead. The body usually contains the created resource or a link to it.

Status code201
NameCreated
Class2xx Success
Defined inRFC 9110 §15.3.2
Cacheable by defaultNo, unless Cache-Control says so
Safe to retry automatically?Not applicable
Related headersLocation

What causes HTTP 201?

  • A successful POST or PUT that created a record.

How do I fix HTTP 201?

  1. Return a Location header with the new resource’s URL.
  2. Use 202 if the work is queued and not finished yet.

What should a client do after HTTP 201?

Read the Location header (and body) to get the new resource. Do not repeat the POST, or you may create a duplicate; use an idempotency key if the client might retry.

Does HTTP 201 affect SEO?

No SEO impact; 201 is for APIs and form handlers, not crawlable pages.

Example 201 response

HTTP/1.1 201 Created
Date: Mon, 01 Dec 2026 12:00:00 GMT
Location: /api/users/42
Content-Type: application/json

{"error":{"status":201,"message":"Created"}}

How to return 201 Created in code

Express (Node.js)

res.status(201).json({ error: 'Created' });

Next.js route handler

return Response.json({ error: 'Created' }, { status: 201 });

FastAPI (Python)

return Response(status_code=201)

PHP

http_response_code(201);

Nginx

location = /example {
    return 201;
}

Other 2xx status codes

The request was received, understood and accepted.

Frequently asked questions

201 vs 200 for POST?
Use 201 when the POST created a new resource (with a Location header). Use 200 when the POST performed an action that did not create a resource, such as a search or a calculation.
Should 201 return the created object?
It is optional but common. Returning the object saves the client a follow-up GET.
Is 201 a client or server error?
Neither. 201 is in the 2xx Success class. The request was received, understood and accepted.