Skip to main content
202

Accepted

Active
RFC 9110 §15.3.3Since 1996Async APIs, job queues, batch processing

HTTP 202 Accepted indicates the request has been accepted for processing, but the processing has not been completed. Defined in RFC 9110 §15.3.3. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.

Description

The 202 Accepted status code indicates that the request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.

There is no facility in HTTP for re-sending a status code from an asynchronous operation. The 202 response is intentionally noncommittal — its purpose is to allow a server to accept a request for some other process without requiring the user agent to wait.

Examples

Request to start async job
http
POST /api/reports/generate HTTP/1.1
Host: api.example.com
Content-Type: application/json

{"type": "monthly", "month": "2024-01"}
202 response with job tracking
http
HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /api/reports/jobs/abc123

{"job_id": "abc123", "status": "queued", "estimated_completion": "2024-01-15T10:35:00Z"}

Edge Cases

  • 202 does NOT guarantee the request will be fulfilled — the job may fail during async processing.
  • Always provide a way for the client to check the job status (Location header or job_id in body).
  • Do not use 202 for synchronous operations that complete before the response is sent (use 200 or 201).

When You'll See This

  • Triggering a long-running report generation
  • Submitting a batch processing job
  • Sending a video for transcoding
  • Queuing an email campaign for delivery

Implementation References

LanguageConstant
Gohttp.StatusAccepted
Rusthttp::StatusCode::ACCEPTED
Pythonhttp.HTTPStatus.ACCEPTED
Node.jshttp.STATUS_CODES[202]
.NETHttpStatusCode.Accepted
JavaHttpURLConnection.HTTP_ACCEPTED

History

Introduced in HTTP/1.0 (RFC 1945, 1996). Became critical with the rise of async APIs and microservices where operations may take seconds or minutes to complete.

Related Status Codes

Related Headers

FAQ

What is the difference between 200 and 202?

200 means the request completed successfully. 202 means the request was accepted but hasn't finished processing yet — it's queued for later execution.

How should clients handle a 202?

Poll the status URL (from the Location header or response body) periodically until the job completes, or use webhooks if the server supports them.