Logo
DevUtilsAll-in-one toolkit
Back to all codes
2022xx
2xx — Success

Accepted

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

What it means

The HTTP 202 Accepted response code indicates that the request has been accepted for processing, but the processing has not been completed; in fact, processing may not have started yet. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.

It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request.

How it works

  • 1The client submits a request that requires heavy background processing.
  • 2The server validates the request format and queues it for a background worker (e.g., Celery, RabbitMQ).
  • 3The server immediately responds with '202 Accepted' so the client isn't blocked waiting.
  • 4The server includes a URL in the response (or a Location header) where the client can poll for status updates.

Why you're seeing this

  • The operation is asynchronous and was successfully queued.

How to fix it

  • Clients should be programmed to poll the provided status endpoint (or listen for a webhook/WebSocket event) to know when the operation actually finishes.

Framework Implementations

Spring Boot (Java)

@PostMapping("/process")
public ResponseEntity<String> startProcessing() {
    jobService.submitAsyncJob();
    return ResponseEntity.accepted().body("Job queued");
}

Real-Life Scenarios

Use this for asynchronous operations, batch processing, video encoding, report generation, or anytime an operation will take more than a few seconds to complete.

Generating a Heavy Report

A user clicks 'Export all transactions to CSV'. The server queues the 10-minute job and returns 202 Accepted with a link to check the progress.

Video Encoding

Uploading a 4K video. The upload finishes, but the server must transcode it to 1080p, 720p, etc. It returns 202 Accepted.

HTTP Transaction

1. Client Request

POST /api/v1/reports/monthly HTTP/1.1
Host: api.finance.com
Content-Type: application/json

{
  "month": "July"
}

2. Server Response

HTTP/1.1 202 Accepted
Location: /api/v1/jobs/job_99812
Content-Type: application/json

{
  "status": "queued",
  "jobUrl": "/api/v1/jobs/job_99812"
}

SEO Implications

Minimal direct SEO impact. Search engines do not typically interact with asynchronous queues.

Related Codes