202

Accepted

2xx Success

Back to list

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

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

Examples

Queued export job

Request:POST /api/reports/export
Response:202 Accepted with Location: /api/jobs/789

The server accepts the request and points the client to job status instead of pretending the export is already done.

References

Related 2xx Success Codes