Success
202

Accepted

The request has been accepted for processing, but the processing has not been completed yet.

# Quick Definition

The 202 Accepted status code indicates that the request has been received and understood, and that it has been accepted for processing. However, the processing has not been completed and may not have even started yet. The request might ultimately be acted upon or rejected once processing actually takes place.

# When Does a 202 Response Occur?

A 202 response is returned when the server needs to acknowledge receipt of a request but cannot process it immediately. This is the standard pattern for asynchronous operations where the work will be performed in the background -- such as generating a report, processing a video upload, or sending a batch of emails.

The key distinction from a 200 OK is that 202 explicitly communicates "I got your request and will work on it" rather than "I completed your request." The response body typically includes a job ID or status URL that the client can poll to check progress.

# Common Use Cases

# Best Practices

  1. Return a status endpoint -- Include a Location header or a URL in the response body where the client can poll for the processing result.
  2. Include a job identifier -- Provide a unique ID (e.g., job_id) so the client can track and reference the async operation.
  3. Validate before accepting -- Perform input validation synchronously and return 400/422 for invalid requests. Only return 202 for valid requests that will be processed.
  4. Offer webhook callbacks -- In addition to polling, let clients register a callback URL to receive a notification when processing completes.
  5. Document expected processing time -- Help clients set appropriate polling intervals by indicating estimated completion time in the response.

# HTTP Example

Request
POST /api/reports/generate HTTP/1.1
Host: api.example.com
Content-Type: application/json

{
  "type": "annual-summary",
  "year": 2025
}
Response
HTTP/1.1 202 Accepted
Content-Type: application/json
Location: /api/reports/status/rpt_abc123

{
  "job_id": "rpt_abc123",
  "status": "queued",
  "status_url": "/api/reports/status/rpt_abc123",
  "estimated_time": "30s"
}

# Related Status Codes

# Frequently Asked Questions

Does 202 mean the request was successful? +
Not exactly. A 202 Accepted means the server has received and validated the request, and it has been accepted for processing. However, the processing has not been completed yet, and it may ultimately succeed or fail. The 202 does not guarantee the final outcome -- it only confirms the request was accepted into the processing queue.
How should the client check the result of a 202 request? +
The most common approach is polling: the 202 response includes a Location header or a status URL in the response body that the client can check periodically. Alternatively, use webhooks where the server calls back to the client when processing is complete. Some APIs also use Server-Sent Events or WebSocket connections for real-time status updates.
When should I use 202 instead of 200? +
Use 202 when the request triggers a process that will take significant time to complete -- such as video encoding, report generation, batch processing, or sending emails. Use 200 when the request can be fully processed and the result returned within the same HTTP response. If the client needs to wait for the result, 202 with a polling mechanism is the right pattern.

Monitor your uptime 24/7

Track API response codes, uptime, and performance for all your async endpoints around the clock.

Start Free Monitoring