All entries

    Design a Job Status API with 202 Accepted

    Return 202 Accepted when a job has been queued and provide a status URL clients can read independently.

    A worker drops a job ticket into a bin beside a status board
    Conceptual pixel-art illustration.

    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.

    Teaching example
    HTTP/1.1 202 Accepted
    Location: /jobs/export-42
    Content-Type: application/json
    
    {"id":"export-42","state":"queued","statusUrl":"/jobs/export-42"}
    EXPLAINED / SEQUENCE

    Client, API and worker

    Return 202 Accepted when a job has been queued and provide a status URL clients can read independently.

    Example

    1. Client

      POST with an idempotency key

    2. API

      store the job and return 202

    3. Worker

      update the durable record

    4. Client

      GET the authorized status URL

    THE KEY DISTINCTION

    GET the authorized status URL

    Conceptual diagram for the synthetic example in this guide.

    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.

    FURTHER READING

    Sources

    Technical references checked .

    END OF ENTRY / 36
    Eeshan Singh with Big Ben in London
    BEHIND THE JOURNAL

    Eeshan Singh

    I’m Eeshan Singh Pokharia, an AI Full Stack Developer and CoFounder of UltraFit360. I work across AI features, full-stack product development, and web and mobile experiences—from Figma and frontend interactions to the systems behind them.

    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.

    Meet the author
    THE CONVERSATION

    Your side of the story.