Accepted
2xx Success
Last updated:
The request has been accepted for processing, but the processing has not been completed.
Description
Used for async operations: the server has queued the work but has not finished it yet. The response typically includes a Location header pointing to a status endpoint, or a task ID the client can poll.
When to use
Return 202 when starting long-running background jobs (video encoding, batch imports, sending emails) so the client can poll for completion.
Specification
RFC 9110 §15.3.3
Examples
HTTP/1.1 202 Accepted
Content-Type: application/json
{"ok":true}res.status(202).json({ error: "Accepted" });w.WriteHeader(http.StatusAccepted)
return jsonify({"error": "Accepted"}), 202Related status codes
Created
A new resource has been created as a result of the request. The URI of the new resource is in the Location header.
No Content
The request succeeded, and there is no additional content to send in the response body.
See Other
The response to the request can be found under a different URL, and the client should perform a GET to that URL.