Atomside docsThis page as Markdown

Idempotency

A retry never sends a letter twice.

Every call that makes something you could pay for (send_letter, start_account) needs an idempotency key: your own unique string, up to 255 printable characters. Over REST it is the Idempotency-Key header; over MCP, the idempotency_key argument; in the CLI, --idempotency-key; in the TypeScript SDK, the idempotencyKey option.

What we do with it

A "not yet" answer is stored too: a retry of a send that waits for approval gets the same letter and the same link, not a second letter.

create_approval_link takes a key too. Its answer holds a secret (the link's url), so we keep only the link's id against the key and make the url again on a retry. If the link has been used, revoked or has run out by then, the retry is refused approval_link_gone rather than handed a link that no longer works. See Sending for your customers.

A group is one send with one key. A retry returns the same group and the same letters, however far the first call got: the group and its letters are written together or not at all. Each letter's record counts the retry. See One letter to several people.

Choosing keys

Make the key from what the letter is, not from when you sent it: rent-review-2026-tenancy-4471, not a random value made fresh on each attempt. Then a retry after a timeout, a crash or a lost answer is always the same key.

If you are not sure whether an earlier attempt went through, either repeat it with the same key, or look first with list_letters (by reference or recipient) before sending anything new.

What it does not cover

An idempotency key stops the same call twice. It does not stop a second, different call for the same letter: a new quote sent with a new key is a new letter. The duplicate catch (identical letters to the same person and address within 7 days wait for a person, as possible_duplicate) is a safety net, not a substitute.