202 Accepted
The request was accepted for processing but is not finished, and may still fail. Nothing has necessarily happened yet.
At a glance
- Status code
- 202 Accepted
- Class
- 2xx, success, the request was received and accepted
- Defined in
- RFC 9110
- Cacheable by default
- by explicit headers only
- Response body
- A pointer to the job status, ideally with a URL to poll.
In detail
202 deliberately makes no promise about the outcome. It says the work is queued. The response should hand the client somewhere to look for the result, because the original connection carries no further information.
Right for anything that outlives the request: video encoding, bulk import, report generation. Wrong for work that completes in milliseconds, where it just forces the client into a pointless polling loop.
Always include a status URL. A 202 with an empty body is a dead end: the client knows the job exists and has no way to ever learn what happened to it.
Examples
HTTP/1.1 202 Accepted
Location: /api/jobs/3f9a
Content-Type: application/json
{"job":"3f9a","state":"queued"}Things that catch people out
- 202 is not a success. Monitoring that counts 2xx as healthy will report a green service while every queued job is failing.
- Clients that follow Location on a 202 with a GET expecting the finished resource will get the job record instead. Document which one the URL returns.
Try it: HTTP Request Builder
Build a request with any method, headers and body, send it, and read the status line the server returns.
HTTP Request Builder
LOCAL · Browser-OnlyBuild and test HTTP requests with custom headers and body
Authentication
Headers
Generate Code
curl -X GET 'https://api.example.com/endpoint' \
-H 'Content-Type: application/json'Showing a sample URL. Enter your endpoint above to update the snippet.
Related HTTP status codes
All http status codes →201 Created
The request succeeded and created one or more new resources. The Location header carries the URL of the primary one.
200 OK
The request succeeded. What the body contains depends on the method: a GET returns the resource, a POST returns the result of the action.
303 See Other
The result of the request is at another URL, and the client should fetch it with GET regardless of the original method.
203 Non-Authoritative Information
The request succeeded, but a proxy between you and the origin server altered the response body or headers.
204 No Content
The request succeeded and there is deliberately nothing to send back. The browser stays on the current page.
205 Reset Content
The request succeeded and the client should clear the form that sent it, ready for another entry.
Tools for this
- HTTP Request Builder Free online HTTP request builder - build and test HTTP requests with custom headers and body
- HTTP Headers Checker Free online HTTP headers checker - view HTTP response headers for any URL