202

Accepted

2xx Success

ELI5

We got your request and we're working on it! We'll process it later, but don't wait around - check back later to see if it's done.

Server perspective

Use 202 when the request is accepted but the real work will finish later, if it finishes at all.

When to use

  • Return 202 for queued jobs, asynchronous workflows, and long-running processing
  • Use it when the server is deliberately not committing to an immediate final outcome
  • Long-running background tasks
  • Batch processing operations
  • Email sending or bulk operations
  • File processing that takes significant time
  • Queue-based systems where processing happens asynchronously

How to respond

  • Include enough status or tracking information for the client to monitor progress
  • Return a job URI or status endpoint when the API supports follow-up polling

Headers to consider

  • Location

Response body

  • Include a job identifier, monitor URL, or current accepted state in the response body

Server-side pitfalls

  • Do not use 202 when the operation already completed and a final status is available
  • Do not imply guaranteed success if background processing can still fail
  • Immediate processing that completes quickly (use 200 OK)
  • Resource creation that happens immediately (use 201 Created)
  • When the operation completed synchronously with no body to return (use 204 No Content)
  • When you need to guarantee completion before responding

Examples

Bulk email sending

Request:POST https://api.example.test/api/emails/bulk
Response:202 Accepted # Headers Content-Type: application/json # Body { "jobId": "job_123", "status": "queued" }

The server queued the job, but the actual sending result is not known yet.

Large file processing

Request:POST https://api.example.test/api/files/process
Response:202 Accepted # Headers Location: https://api.example.test/api/jobs/456

The server accepted the work and gives the client a place to monitor progress.

References

Related Status Codes