Idempotency
When a command returns 202 Accepted, it enters an async processing pipeline. If your
request times out or you lose the response, you need to know whether it’s safe to retry.
Safe-by-design commands
Many Clossir API commands are idempotent by design — repeating the same request produces the same outcome without side effects:
For these endpoints, retrying after a timeout is safe — the API detects the duplicate and returns the existing resource.
Commands with side effects
Some commands are not inherently idempotent:
For these, use the requestId from the 202 response to check whether the original command
was received before retrying:
Best practices
-
Store the response — always persist the
202response body (especiallyrequestIdand the resource ID) before moving on. If your process crashes after receiving the response, you can look up the resource. -
Use webhooks — for critical commands, subscribe to webhooks rather than relying on polling. The webhook payload includes the
requestIdfrom your original command. See Async Operations for the correlation pattern. -
Configure retries conservatively for commands — the SDK’s built-in retry handles transport errors (timeouts, 5xx). For 202 commands, the retry is safe because the server didn’t process the command if it returned a 5xx or timed out:
Next steps
- Async Operations — the full 202 command lifecycle
- Retries & Backoff — configure retry strategies
- Error Handling — handle errors from failed commands