HTTP 201 — Created
HTTP 201 says a new resource now exists because of the request. Well-behaved APIs pair it with a Location header pointing at the new resource and a body describing it.
When 201 shows up
- POST endpoints that create a record — orders, users, drafts.
- REST APIs distinguishing "made something" (201) from "did something" (200).
Mocking a 201 response
A response with this status can be faked end to end with a local mock rule — no backend changes needed. The configuration below mirrors the rule fields the ApiSimul editor uses (method, path, status, delay in milliseconds, response body):
{
"method": "GET",
"path": "/api/orders",
"status": 201,
"delay": 400,
"enabled": true,
"body": {
"id": "{{string.uuid}}",
"status": "created",
"note": "{{string.lorem 6}}"
}
}Dynamic placeholders such as {{random.name}}, {{string.uuid}} or {{number.int 1 100}} can appear inside the body to vary each response, which keeps client-side list rendering and retry logic honest during development.
Frequently asked questions
What does HTTP 201 mean?
The request created a new resource. The response body usually contains the created object, often with a server-assigned id.
How can I test a 201 response without a real backend?
Define a mock rule with the method and path your client requests and set the status to 201. The example configuration above returns this response after the listed delay, so the client exercises its 201 handling exactly as it would against a live server.
Related status codes
Need the response in your own project? Spin up rules for any status with the ApiSimul mock server, or browse every status code page.