# 202 Accepted

> https://http-status.org/docs/202

**Family:** 2xx Success

## Rationale

Request accepted for processing but action not yet enacted.

## In Plain Terms

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.

## Description

The HTTP 202 Accepted status code indicates that the request has been accepted for processing, but the processing has not been completed. The response is non-committal - the action may succeed or fail when actually processed.

## Server Perspective

### Usage
- 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

### Implementation
- 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

### Common Headers
- Location

### Body
- Include a job identifier, monitor URL, or current accepted state in the response body

### 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

## Client Perspective

### Pitfalls
- Do not show 202 as 'done' in the UI unless the product intentionally abstracts the async step

## Examples

### Bulk email sending

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

**Request:**
```
POST https://api.example.test/api/emails/bulk
```

**Response:**
```
202 Accepted
Content-Type: application/json

{
  "jobId": "job_123",
  "status": "queued"
}
```

### Large file processing

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

**Request:**
```
POST https://api.example.test/api/files/process
```

**Response:**
```
202 Accepted
Location: https://api.example.test/api/jobs/456
```

## Related Codes

- [200 OK](/docs/200.md)
- [201 Created](/docs/201.md)
- [204 No Content](/docs/204.md)

