An application asks a service to create a report. The service responds immediately with HTTP 202 Accepted. That is useful news: the request was accepted for processing. It is not proof that the report exists, that every row was included or that the eventual operation will succeed.
A long-running operation can continue after the initial response. To establish what happened, follow the API’s documented operation identifier, status and final result, then verify the output needed for the business task. A green response to one request and a completed job are different observations.
What does 202 actually say?
HTTP Semantics, RFC 9110 defines 202 as acceptance for processing that has not completed. The request may or may not ultimately be acted on. The response is intentionally noncommittal because a separate process may complete or reject the work later.
The standard says the response representation ought to describe current status and point to or embed a status monitor. That is not a promise that every API will provide a particular URL, field name or polling interval. Read the specific API contract, including how to retrieve results, interpret errors and authenticate subsequent requests.
Also avoid the opposite shortcut: a response with a different 2xx code does not universally prove every background action is finished. Google Cloud Storage’s long-running-operation documentation gives a service-specific example where an initial HTTP 200 can accompany an operation that later fails. It instructs clients to inspect the operation metadata and outcome. That behavior describes the documented service, not a rule for every 200 response.
A fictional report job
Suppose an internal application sends a report request on Monday at 9:00. The API returns 202 and an operation identifier, report-418, under the fictional service’s documented contract. At 9:01, the operation endpoint reports “running.” At 9:04, it reports “failed” because one required input could not be accessed.
The original request was accepted. The report job did not succeed in this example. Showing “report complete” at 9:00 merely because the first response was in the 2xx class would mislead the user and could cause another process to look for a file that was never created.
Now consider a different run, report-419. Its status eventually reports “completed” and returns a file reference. The application still needs to check the contract for what completion means and, where the task requires it, verify that the file can be retrieved and matches the requested period and expected content. A completed operation and a usable downstream artifact are related milestones, but they are not identical claims.
Build a small state trail
For each operation, retain the request reference, operation identifier, submission time, latest observed status, last check time and any terminal result or error. Record the destination or artifact identifier when the service supplies one. Avoid putting access tokens, customer data or sensitive signed links in broadly accessible logs.
Useful application states might include submitted, in progress, succeeded, failed and unknown. They are design choices, not universal API statuses. The service may use different labels or return an operation object with a boolean, error and response. Map the actual documented states explicitly instead of treating every unfamiliar value as success.
For example, Google’s operation-resource documentation describes a done field and separate error or response fields for that service. A client must still interpret the API’s own contract. A completed status can represent failure or cancellation; an empty error field before completion is not proof of success.
Monitor the job, not just the connection
If the API supplies a status endpoint, use the identifier from the original response and follow its documented polling guidance. A poll that fails because the network is unavailable does not itself prove the operation failed. Preserve the operation reference and distinguish “could not check” from a terminal failure reported by the service.
Use a bounded check schedule appropriate to the service. Polling dozens of times per second is not evidence of faster processing and may trigger rate limits. The HTTP 429 guide covers throttling and service-specific retry instructions. If the API supports a callback or webhook, the receiver still needs to verify and reconcile the event according to that system’s rules.
For a user-facing interface, show what is actually known: “Request submitted,” “Processing,” “Could not check status,” or “Report ready” only when the relevant evidence supports that message. If progress is an estimate or unknown, say so. A percentage that has not changed may reflect reporting limits rather than a stalled job.
A timeout is not proof that nothing happened
Suppose a client submits a request, but the connection fails before the response arrives. The service may have received and started the request, or it may not have received it. Immediately submitting the same action again can create a duplicate if the operation is not protected against duplication.
Check the API’s documented retry and status-recovery mechanism. Some systems accept an idempotency key or expose a client-supplied request identifier that allows the original operation to be found. Others require a different reconciliation process. The idempotency guide explains why a repeated request and a new business action should not automatically be treated as the same thing.
Do not invent an operation identifier or mark the request failed just because the client lost its response. If the service cannot establish the result, keep the state unknown and follow the organization’s process for resolving it. For a payment, data transfer or other consequential action, the right next step may be to inspect the destination or obtain an authoritative record before trying again.
What does a final status cover?
An API can report completion for the operation it owns while a later process is still pending. An export job may have written a file, while another system has not yet imported it. A delivery provider may have accepted a message, while the recipient’s system has not confirmed delivery. Those examples are conceptual; the actual service’s documentation defines its statuses.
Identify the outcome the user asked for and the system capable of establishing it. If the request is “produce a report,” verify the report where it can be accessed. If it is “update the destination,” verify the destination’s record. A source-system completion flag can be important evidence without answering every downstream question.
Similarly, a cancellation request is not always an already-canceled operation. Check whether the service reports that cancellation was requested, accepted or completed and whether partial work remains. The correct handling depends on the API and the effect of the job.
Questions for the integration
What does the initial response establish? Where is the operation identifier? Which status values are terminal, and how are errors represented? How should the client check progress without exceeding service limits? What happens if submission times out? Which destination or artifact verifies the user’s desired outcome?
Answer those questions in the integration and in the interface. A useful status tells people what has happened, what is still in motion and what can be verified. It should not convert “we accepted the request” into “the work is done.”
Explore Infinite Upside
For Vijay Sheth’s personal accounts, read Infinite Upside: Building Wealth With Room to Live, published by Sheth Capital, Inc.
Explore the work behind ownership
Choose an edition