DevKits
202

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 response
HTTP/1.1 202 Accepted
Content-Type: application/json

{"ok":true}
Node.js (Express)
res.status(202).json({ error: "Accepted" });
Go (net/http)
w.WriteHeader(http.StatusAccepted)
Python (Flask)
return jsonify({"error": "Accepted"}), 202

Related status codes

All 2xx codes