HTTPfy

202 Accepted

The request was accepted for processing, but processing has not finished.

202 at a glance

Code
202
Name
Accepted
Class
2xx Successful
Status
IANA-registered standard code
Defined in
RFC 9110, Section 15.3.3
Cacheable by default
No by default. Caches store it only when the response carries explicit freshness (Cache-Control max-age, s-maxage or Expires).

What 202 means

202 Accepted is non-committal: the server queued the work and makes no promise about the outcome. It is the right status for asynchronous jobs such as video encoding, report generation or bulk imports. Good APIs return a link where the client can poll for the result.

What typically causes a 202

  • Job-queue style APIs (exports, batch operations, webhooks forwarded to a queue).
  • Cloud APIs that start long-running operations, such as Azure Resource Manager async operations.

Fix it on the server

  • Return a status URL (Location, or a link in the body) and, ideally, a Retry-After hint for polling.
  • When the job finishes, have the status resource return 303 to the result or include it directly.

Fix it as a client or visitor

  • Poll the status URL respecting Retry-After, or use the webhook the API offers; do not resubmit the job.

Headers that go with 202

HeaderRole
LocationOften points to a job or status resource.
Retry-AfterSuggested polling interval.

Example response

HTTP/1.1 202 Accepted
Location: /jobs/7f3c
Retry-After: 5
Content-Type: application/json

{"job": "7f3c", "state": "queued"}

Opens the HTTP headers tool with your URL filled in; it shows the status line and headers of every redirect hop.