Question-led guide · diagnostic

An API returned HTTP 200—but did the operation actually succeed?

An outcome-state model that separates HTTP response success from acceptance, commit, visibility, confirmation, and durable business effect.

Direct answer

HTTP 200 establishes the semantics of the response, not the full business outcome. Define the operation's states—received, authorized, accepted, committed, visible, confirmed, compensated, or unknown—and return a stable operation or idempotency identifier. Verify the intended effect from an authoritative read model or event, and distinguish delayed success from a transport response that arrived before downstream work completed.

Scope

Use this guide for APIs that create durable domain effects: provisioning, payment, deployment, messaging, account changes, data updates, or workflow starts. It is especially important when an agent calls the API, because a model may equate a successful tool response with a completed objective.

Why it happens

Several events are compressed into “success.” The server may parse and authorize a request, enqueue work, commit one database row, publish an event, update a downstream provider, refresh a read model, and finally produce a user-visible effect. HTTP describes one exchange in that chain.

A connection can also fail after the server commits but before the caller receives the response. The caller sees an error and retries, while the business effect already exists. Conversely, a 200 response can contain a domain-level rejection or report acceptance before later processing fails.

Diagnosis

Choose one operation and draw its state transitions. Name the system of record for each transition and the evidence a caller can observe. Then inject failures:

  1. after authorization but before commit;
  2. after commit but before response;
  3. after queueing but before a worker runs;
  4. after a downstream effect but before local confirmation;
  5. during compensation.

Check whether the client can distinguish retryable failure, permanent failure, success, and unknown outcome. If its only evidence is a status code or model-generated sentence, the contract is incomplete.

Solution

Give every operation a caller-supplied idempotency key or stable request ID with defined scope and lifetime. Return an operation resource that exposes current state, accepted parameters or digest, timestamps, target, and failure or compensation details.

Define a terminal business condition independently of transport. For a deployment, it may include the desired version observed healthy in the target environment. For a message, it may mean accepted by the provider, not read by the recipient; label that boundary honestly.

When the outcome is unknown, reconcile by operation ID and authoritative target state before retrying. Instrument the transitions so evaluation can grade actual effects rather than tool-response text.

Artifact

Adapt this state model:

State Meaning Authoritative evidence Allowed next step
received Request parsed and identified Request ledger Authorize/reject
authorized Current policy permits proposal Decision record Validate preconditions
accepted Work admitted but incomplete Operation resource Poll/subscribe/cancel
committed System-of-record mutation completed Commit/effect record Verify downstream state
visible Intended read model reflects effect Versioned authoritative read Confirm outcome
confirmed Domain success condition met Outcome verifier Close
failed Terminal failure with no intended effect Failure record Repair/new request
compensated Prior effect reversed within stated boundary Compensation record Review residual effects
unknown Evidence cannot distinguish states Gap record Reconcile; do not blind retry

Common mistakes

  • Mapping every 2xx response to completed.
  • Returning no stable operation identifier for asynchronous work.
  • Retrying after a timeout without checking for an existing effect.
  • Reading from a cache and treating it as authoritative confirmation.
  • Claiming rollback when compensation leaves external or user-visible residue.

Evidence

  1. HTTP status codes communicate request and response semantics, while application-specific meaning remains defined by the resource and method.

    RFC 9110 defines HTTP semantics, methods, status codes, representation metadata, and the meaning of successful 2xx responses.

    Primary source · standard · checked Aug 26, 2026

    Limit: HTTP semantics cannot prove that a domain-specific asynchronous workflow completed or that an external user observed its effect.

  2. Idempotent API design uses caller-provided request identity and explicit handling of repeated requests to make retries safer.

    The Amazon Builders' Library article explains semantic equivalence, client request identifiers, late requests, and idempotent API behavior.

    Primary source · official-doc · checked Aug 26, 2026

    Limit: It is AWS engineering guidance and does not guarantee exactly-once effects across arbitrary external systems.

  3. Business success should be represented as an observable state transition with a stable operation identity.

    The outcome-state model below makes ambiguity and delayed completion explicit to callers and operators.

    Signal Studio author framework · reviewed Aug 26, 2026

    Limit: State names and confirmation sources must match the actual domain and consistency model.

Limitations

The model does not create atomicity across services. Messages can be delayed, read models can lag, external providers may lack idempotency, and compensation may be partial. Document consistency, observation, and reconciliation semantics for the exact operation.

FAQ

Should an asynchronous API return 202 instead of 200?
202 Accepted can communicate that processing is incomplete, but the API still needs an operation resource, status semantics, failure states, and a way to verify the eventual effect.
Can I verify success by reading the same service immediately?
Only if that read is authoritative for the desired effect and its consistency guarantees are understood. A cache or lagging replica can create false negatives or stale positives.

Continue within Engineering judgment with AI, or use one of these adjacent diagnostics:

Editorial QA: automated native-English, structure, source-presence, and link checks completed . This record is not an independent expert endorsement. Review boundary.