Return 202 Accepted when a job has been queued and provide a status URL clients can read independently.
Build the example
For a file conversion, POST to create the job, store its initial queued state and return an ID with a Location or explicit status link. GET returns the current state for the authorized owner. Represent accepted cancellation separately from confirmed cancellation because a worker can finish while the cancel request is in flight. Attach results only when the work is complete.
Start a worker that sleeps briefly and writes a text result, then restart the client during the sleep. The reopened client should use the same job reference rather than submitting another job. Try requesting the result before it exists and make the empty state explicit. Separating the job record from the file keeps that error understandable.
HTTP/1.1 202 Accepted
Location: /jobs/export-42
Content-Type: application/json
{"id":"export-42","state":"queued","statusUrl":"/jobs/export-42"}Client, API and worker
Return 202 Accepted when a job has been queued and provide a status URL clients can read independently.
Example
- Client
POST with an idempotency key
- API
store the job and return 202
- Worker
update the durable record
- Client
GET the authorized status URL
GET the authorized status URL
Watch the failure boundary
Treat 202 as acceptance rather than completion in the interface. Give the job record an expiration policy and a reason for failure that is safe to display. Return a stable result link after success and a separate explicit retry action after failure. If the queue is unavailable before acceptance, tell the caller immediately.
Verify the behavior
Repeat the creation request with the same idempotency key after simulating a dropped connection. The server should resolve it to the original job. Test a nonexistent job, a job owned by another test account and a job that exceeds its worker deadline. Specify each response so the UI can leave the spinner on purpose.
Sources
Technical references checked .



