> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atlaswork.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Idempotency

> Make every state-changing call safe to retry.

Signing is high-stakes: a double-send is a real-world incident. Atlas makes all
state-changing operations idempotent so that network retries are always safe — a
retried call cannot double-create or double-send.

## How it works

State-changing requests accept an idempotency key. Atlas remembers the first
request made with a given key and returns the same result for any retry that
reuses it, instead of performing the operation again.

```bash theme={null}
curl -X POST https://api-atlaswork.vercel.app/api/v1/envelopes \
  -H "Authorization: Bearer $ATLAS_API_KEY" \
  -H "Idempotency-Key: 8f1c2b9a-..." \
  -H "Content-Type: application/json" \
  -d '{ "...": "..." }'
```

<Tip>
  Generate one key per logical operation (for example, a UUID created before the first attempt) and
  reuse it across retries of that same operation. Use a fresh key for a genuinely new operation.
</Tip>

## The SDK supplies keys automatically

The TypeScript SDK auto-supplies an idempotency key for every write, so retries
through the SDK are safe by default — you don't have to manage keys yourself
unless you want explicit control.

## On the MCP surface

Every write an agent performs through the [MCP server](/mcp/overview) is
idempotent by default. This is deliberate: agents retry, and a retried tool call
must never double-send a contract. See the [MCP tools](/mcp/tools) reference for
per-tool behavior.

<Note>
  Idempotency pairs with the review-first default: even if an agent retries the "send for review"
  call, the human still approves exactly one envelope.
</Note>
