Skip to content
Webhooks and APIs3 min read

By · Editorial policy

An API Write Timed Out. Did It Succeed?

Treat an API write timeout as an unknown outcome when the request may have reached its destination. Look up the provider operation using its business reference, or use the provider’s documented same-key retry behavior. Record the receipt before closing the incident.

What is the practical answer?

Treat an API write timeout as an unknown outcome when the request may have reached its destination. Look up the provider operation using its business reference, or use the provider’s documented same-key retry behavior. Record the receipt before closing the incident. Imagine a staging payment provider accepts operation pay_85, then your reverse proxy drops the connection before the worker receives the response. Your HTTP client is right that the request timed out. The provider is also right that the operation succeeded. The two facts describe different systems. An immediate retry using a fresh identifier can create a second operation. Store the request digest, original provider key, account context, attempt timestamp, and business reference before dispatch. When a request is uncertain, restrict competing workers from issuing another write. Look up the operation by the provider’s reference if available.

Evidence: Stripe idempotent requests · Reddit workflow reliability discussion

  1. Send original requestExternal action
  2. Record unknown outcomeRecovery
  3. Find original operationDecision
  4. Save confirmed receiptProcess
A timeout routes to reconciliation before the system considers any new external write.

Separate response loss from a rejected request#

Store the request digest, original provider key, account context, attempt timestamp, and business reference before dispatch. When a request is uncertain, restrict competing workers from issuing another write. Look up the operation by the provider’s reference if available. Consider documented consistency delays: an immediate empty lookup may be inconclusive, especially when visibility is asynchronous.

What you findWhat to do
Confirmed receipt existsreturn it and close the unknown state.
Provider lookup is empty but results can lagrecheck on a bounded schedule.
Provider offers neither a safe key nor authoritative lookupmake the unknown state visible to an operator.

Make your retry decision explicit#

A response proving rejection before execution can permit a corrected request, per provider rules. Confirmed effects should return their original receipt. Unknown effects can retry only under a provider contract that covers the attempt, including the key scope, payload requirements, and retention period. Keep an unresolved case open for review if those conditions are missing.

Choose the identity before the HTTP call#

For a charge, define an intent such as account plus invoice plus collection version. Keep a durable mapping to the provider account and key, an operation state, and a digest of the payload. Multiple workers should converge on that mapping before dispatch. A modified amount belongs in a reviewed change to the business intent, not a guessed retry of the old operation.

Put a time limit on automated reconciliation and distinguish an expired provider key from a transient lookup failure. These cases require different evidence. For the first, prove the fate of the original write before using a new key. For the second, retry looking up the original reference when permitted. Avoid reporting an unresolved timeout as either success or a clean failure.

Verify it with a failure drill#

Use a sandbox provider or stub that creates one object and then drops its first response.

  • Expect the local outcome to enter unknown, then reconcile to the original provider ID. Confirm the provider still has one object after a worker restart.

Sources and further reading

Official references support technical claims; community discussions are used only as problem signals.