Back to all status codes
202
Accepted
The request has been accepted for processing, but the processing has not been completed.
Common Causes
- •Asynchronous processing
- •Queued tasks
- •Batch operations
- •Background jobs
Code Examples
// Express.js - Async task
app.post('/api/reports', async (req, res) => {
const jobId = await queueReportGeneration(req.body);
res.status(202).json({
message: 'Report generation started',
jobId,
statusUrl: `/api/jobs/${jobId}`
});
});