Retries & idempotency
Recover without duplicating resources or website actions.
Preserve the creation key
With an initialized TypeScript client and an operation key saved by your application:
const params = { timeoutSeconds: 300 };
const session = await client.sessions.create(params, {
idempotencyKey: savedOperationKey,
});Retry an uncertain creation with the same key and parameters. An accepted replay may return the original starting snapshot; fetch current state before connecting. Different parameters produce IDEMPOTENCY_CONFLICT.
Choose a recovery action
| Result | Action |
|---|---|
| Confirmed capacity refusal | Honor Retry-After or opt into capacity waiting |
| Creation response lost | Recover with the original key |
| Upload response lost | Inspect session files before uploading again |
| Connection response lost | Inspect session/control state before requesting a new grant |
| Website action response lost | Check the business result before repeating the action |
| Cleanup unconfirmed | Inspect the session; close and wait for release |
Ordinary SDK retries default to zero extra attempts. Explicit safe retries respect the request's deadline and Retry-After. Uploads and connection grants are not automatically replayed.
ResultUnknownError preserves recovery information. The SDK never reruns your task callback or website actions. Owned cleanup may recover an uncertain creation with its original key, then close the recovered resource.
See error codes.