Qaynaq LABS · TOOLS

HTTP · 2xx Success

202 Accepted

Request accepted for processing but not yet completed.

When you see this status

  • Long-running async job (e.g., report generation) accepted
  • Background processing task initiated successfully
  • Request queued for deferred execution

Common causes

  • Server accepted request for async processing
  • Request requires significant backend computation
  • Client requested non-blocking operation

How to debug it

  1. Check server logs for async job status
  2. Verify job completion via provided URI
  3. Ensure client handles Location header

Return this code in your framework

Express (Node.js)
res.status(202).location('/jobs/123').send('Accepted')
FastAPI (Python)
return JSONResponse(status_code=202, headers={"Location": "/jobs/123"}, content={"status": "accepted"})
NestJS
@Post() @HttpCode(202) @Header('Location', '/jobs/123') async createJob() { return { status: 'accepted' }; }
Go (net/http)
w.WriteHeader(http.StatusAccepted); w.Header().Set("Location", "/jobs/123")

About HTTP 202

HTTP status code 202 Accepted is part of the 2xx Success family. Request accepted for processing but not yet completed. Understanding it is essential for backend engineers, API designers, and anyone debugging integrations between services.

The Qaynaq Labs HTTP Status Code Explainer covers all standard codes with practical guidance: what triggers them, how to debug them in production, and exactly how to return them from common frameworks. Each code page is hand-curated and verified.

Frequently asked

How should clients monitor async job progress?

Clients should poll the URI in the Location header or use a webhook if provided by the server.

Can 202 responses include a response body?

Yes, but it's optional. Common practice is to omit the body and rely on headers.

Is 202 idempotent?

No. Retrying a 202 request may create duplicate async jobs unless the server handles deduplication.