202 Accepted means: The request has been accepted for processing but the work is not finished — and might still fail. It deliberately decouples acceptance from completion, which is the standard pattern for asynchronous APIs and job queues. Success 2xx codes confirm the request was received, understood and accepted. The family distinguishes what kind of success happened — content returned, resource created, work queued, or nothing to return — and choosing the precise code is part of a well-designed API contract that clients and caches can rely on. In practice you will meet 202 when a post enqueues a long-running job (report, import, transcode); a bulk operation is scheduled rather than executed inline; an api acknowledges a webhook or batch for later processing. On the client side, poll the status endpoint given in the body or Location header, or subscribe to a callback/webhook; do not treat 202 as success of the underlying work. On the server side, return a job identifier and a way to observe progress; make the eventual outcome observable (status endpoint, webhook, or event) and idempotent on retries.
When 202 happens
- A POST enqueues a long-running job (report, import, transcode)
- A bulk operation is scheduled rather than executed inline
- An API acknowledges a webhook or batch for later processing
How to fix it
On the client
Poll the status endpoint given in the body or Location header, or subscribe to a callback/webhook; do not treat 202 as success of the underlying work.
On the server
Return a job identifier and a way to observe progress; make the eventual outcome observable (status endpoint, webhook, or event) and idempotent on retries.
Should you retry?
Accepted, not finished — poll the job status endpoint with backoff instead of resubmitting.
Debugging steps
When 202 appears unexpectedly, start by capturing the full exchange: 'curl -i' or the browser DevTools Network tab shows the exact status line and response headers, which often carry the real explanation. Success codes rarely need debugging, but verify the body semantics match the code — a 200 wrapping an error payload is an API design bug, not a transport problem. For this code specifically, check whether the most common trigger applies to your situation: a post enqueues a long-running job (report, import, transcode). Compare your exchange against the raw HTTP example above. If you operate the server, correlate the timestamp with application and proxy logs using the request id; if you are the client, verify the request shape against the API documentation before changing anything or retrying.
Notes & gotchas
Pair 202 with idempotency keys: clients that time out while polling may resubmit, and without deduplication you will enqueue the same expensive job twice.
Examples
HTTP/1.1 202 Accepted
Location: /api/jobs/98765
Content-Type: application/json
Content-Length: 76
{
"id": 12345,
"status": "ok",
"message": "Accepted example payload"
} curl -i https://api.example.com/v1/resource # observe the 202 response and its headers const res = await fetch("https://api.example.com/v1/resource");
if (res.status === 202) {
const job = await res.json();
return pollJobStatus(job.statusUrl); // acceptance != completion
} import requests
res = requests.get("https://api.example.com/v1/resource", timeout=10)
if res.status_code == 202:
job = res.json()
poll_until_terminal(job["statusUrl"]) # acceptance != completion Frequently asked questions
Does 202 guarantee the job will succeed?
No. It only guarantees acceptance. The job can still fail; expose a status resource so clients can learn the final outcome.
How should clients poll after 202?
Use exponential backoff and honor any Retry-After hint; stop polling after a terminal state (succeeded/failed) or a deadline.
Which 2xx code should my API return?
200 for a normal result, 201 when a resource was created (with Location), 202 when work is queued, 204 when there is nothing to return. Precision here makes clients, caches and monitors behave correctly.
Can I treat any 2xx as interchangeable success?
For 'did it work' yes, but the distinctions matter operationally: 201 means a resource exists, 202 means work is still pending, 204 means there is no body to parse. Code that ignores them breaks.
Try the JSON Validator
Check JSON syntax and locate errors by line and column.