The request was accepted but hasn’t been processed yet.
When to use it
Queued or background jobs. Return a way to check progress.
Good to know
202 promises nothing about the outcome: the job may still fail later. Return a status URL in Location or the body, such as /jobs/123, and optionally Retry-After to suggest a polling interval. The status endpoint answers 200 with a state like queued, running, done or failed, and when the job is done it can link to the result or redirect there with 303.
Webhooks are the push alternative to polling. Make the work idempotent, because a client that never receives the 202, after a timeout or dropped connection, will resubmit. Put the job on a durable queue such as SQS, a Redis-backed worker or a jobs table before replying: serverless platforms like AWS Lambda freeze the process once the response is sent, so in-process background work may never run.
Success (2xx)
2xx codes mean success: the server received, understood and accepted the request.
What it looks like
HTTP/1.1 202 AcceptedHow to send it
| Node.js / Express | res.status(202).end() |
|---|---|
| Python / Flask | return '', 202 |
| nginx | return 202; |
How to check it
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/