Atomside docsThis page as Markdown

Send a letter: send_letter

Commits a quote: the letter is printed and posted as quoted. Needs an idempotency key; a retry with the same key returns the first letter and sends nothing new. Credits are held now and charged when it is posted. If it needs a person, the answer is "not_yet" with a link to show them (details.show_to_person); then call wait_for_approval. Short of credit, it is "not_yet" waiting_for_credit: the letter goes by itself when credits arrive, and details.auto_top_up says whether a pack is being bought. Never send the same letter again to get past a refusal.

MCP toolsend_letter
RESTPOST /v1/letters
CLIatomside send-letter
Key needsSend (letters:send)
Changes anythingYes, and it cannot be undone.
Idempotency keyRequired: the Idempotency-Key header over REST, the idempotency_key argument over MCP, --idempotency-key in the CLI.

Example

A real call and its real answer, made against the API in test mode. A test runs it again and fails if the answer changes. Ids, keys and links are replaced with stand-ins.

A call that works

REST:

curl -X POST https://api.atomside.com/v1/letters \
  -H "Authorization: Bearer $ATOMSIDE_API_KEY" \
  -H "Idempotency-Key: rent-review-2026-sample" \
  -H "Content-Type: application/json" \
  -d '{
  "quote": "qt_example000000002"
}'

MCP:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "send_letter",
    "arguments": {
      "quote": "qt_example000000002",
      "idempotency_key": "rent-review-2026-sample"
    }
  }
}

CLI:

atomside send-letter \
  --quote qt_example000000002 \
  --idempotency-key rent-review-2026-sample

The answer (HTTP 200; over MCP, the same JSON is the result's structuredContent):

{
  "answer": "yes",
  "letter": "ltr_example000000001",
  "status": "queued",
  "money": {
    "held": {
      "credits": 15,
      "gbp": "1.50"
    },
    "say": "15 credits (£1.50) are held."
  },
  "posting": {
    "posts_on": "2026-11-16",
    "cutoff_at": "2026-11-16T16:00:00.000Z",
    "says": "It prints and is posted today, Mon 16 Nov. It can be cancelled until it goes to print at 16:00."
  },
  "next": "Nothing to do. Read it with get_letter, or wait for the letter.on_record webhook."
}

A refusal: needs_approval

REST:

curl -X POST https://api.atomside.com/v1/letters \
  -H "Authorization: Bearer $ATOMSIDE_API_KEY" \
  -H "Idempotency-Key: rent-review-2026-sample" \
  -H "Content-Type: application/json" \
  -d '{
  "quote": "qt_example000000003"
}'

MCP:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "send_letter",
    "arguments": {
      "quote": "qt_example000000003",
      "idempotency_key": "rent-review-2026-sample"
    }
  }
}

CLI:

atomside send-letter \
  --quote qt_example000000003 \
  --idempotency-key rent-review-2026-sample

The answer (HTTP 202; over MCP, the same JSON is the result's structuredContent):

{
  "answer": "not_yet",
  "code": "needs_approval",
  "fixed_by": "person",
  "say": "Every letter from lettings-helper waits for a person. It is waiting for approval.",
  "money": {
    "charged": {
      "credits": 0,
      "gbp": "0.00"
    },
    "held": {
      "credits": 15,
      "gbp": "1.50"
    },
    "returned": {
      "credits": 0,
      "gbp": "0.00"
    },
    "say": "15 credits (£1.50) are held."
  },
  "retry": "not_needed",
  "retry_after": null,
  "agent_can": [],
  "person": {
    "ask": "Approve or decline this letter",
    "who": "a person who can approve",
    "link": "https://app.atomside.com/a/…",
    "if_nothing": "Nothing is sent."
  },
  "quote": "qt_example000000003",
  "letter": "ltr_example000000007",
  "details": {
    "reason": "asks_every_time",
    "why": "Every letter from lettings-helper waits for a person.",
    "held_credits": 15,
    "status": "waiting_for_approval",
    "approval": {
      "url": "https://app.atomside.com/a/…",
      "expires": "2026-11-18T09:30:00.000Z",
      "covers": "sha256 43341b592305c74063413681ae2bbd2106cd255d3829a72aada68d74272ca368",
      "who_can_approve": "approvers in Residential lettings",
      "also_emailed": true
    },
    "show_to_person": "Letter to Ms A. Sample, 1 page, £1.50. It needs approval before it is posted. Check it at https://app.atomside.com/a/… (approvers only, until 18 Nov 09:30). If you do nothing, nothing is sent."
  },
  "docs": "https://api.atomside.com/docs/refusals/needs_approval",
  "request_id": "req_example000000002"
}

A group that waits for a person: needs_approval

REST:

curl -X POST https://api.atomside.com/v1/letters \
  -H "Authorization: Bearer $ATOMSIDE_API_KEY" \
  -H "Idempotency-Key: rent-review-2027" \
  -H "Content-Type: application/json" \
  -d '{
  "quote": "qt_example000000008"
}'

MCP:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "send_letter",
    "arguments": {
      "quote": "qt_example000000008",
      "idempotency_key": "rent-review-2027"
    }
  }
}

CLI:

atomside send-letter \
  --quote qt_example000000008 \
  --idempotency-key rent-review-2027

The answer (HTTP 202; over MCP, the same JSON is the result's structuredContent):

{
  "answer": "not_yet",
  "code": "needs_approval",
  "fixed_by": "person",
  "say": "Every letter from lettings-helper waits for a person. 3 letters are waiting for approval.",
  "money": {
    "charged": {
      "credits": 0,
      "gbp": "0.00"
    },
    "held": {
      "credits": 45,
      "gbp": "4.50"
    },
    "returned": {
      "credits": 0,
      "gbp": "0.00"
    },
    "say": "45 credits (£4.50) are held."
  },
  "retry": "not_needed",
  "retry_after": null,
  "agent_can": [],
  "person": {
    "ask": "Approve or decline this letter",
    "who": "a person who can approve",
    "link": "https://app.atomside.com/a/…",
    "if_nothing": "Nothing is sent."
  },
  "quote": "qt_example000000008",
  "letter": null,
  "details": {
    "reason": "asks_every_time",
    "why": "Every letter from lettings-helper waits for a person.",
    "held_credits": 45,
    "status": "waiting_for_approval",
    "approval": {
      "url": "https://app.atomside.com/a/…",
      "expires": "2026-11-18T09:30:00.000Z",
      "covers": "3 print files, one sha256 each",
      "who_can_approve": "approvers in Residential lettings",
      "also_emailed": true
    },
    "show_to_person": "3 letters to Ms A. Sample and 2 more, £4.50. They need approval before they are posted. Check them at https://app.atomside.com/a/… (approvers only, until 09:30 on Wed 18 Nov). If you do nothing, nothing is sent.",
    "group": "grp_example000000001",
    "count": 3,
    "letters": [
      {
        "n": 1,
        "letter": "ltr_example000000008",
        "status": "waiting_for_approval"
      },
      {
        "n": 2,
        "letter": "ltr_example000000009",
        "status": "waiting_for_approval"
      },
      {
        "n": 3,
        "letter": "ltr_example000000010",
        "status": "waiting_for_approval"
      }
    ]
  },
  "docs": "https://api.atomside.com/docs/refusals/needs_approval",
  "request_id": "req_example000000003"
}

Input

Over REST, fields in the path go in the path, GET fields in the query string, and POST fields in the JSON body. Over MCP, every field is an argument of the tool.

{
  "type": "object",
  "properties": {
    "quote": {
      "type": "string",
      "description": "The quote id from quote_letter."
    },
    "reason": {
      "description": "Why you send it. Shown to the approver, marked as your words.",
      "type": "string",
      "minLength": 1,
      "maxLength": 500
    },
    "repeat_of": {
      "description": "An earlier letter this one repeats on purpose. A person still decides.",
      "type": "string"
    },
    "on_behalf_of": {
      "description": "Only when the quote had none.",
      "type": "object",
      "properties": {
        "ref": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100,
          "pattern": "^[^@\\s]+$",
          "description": "Your own id for the customer. Never printed."
        },
        "name": {
          "description": "A label. Never printed.",
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        }
      },
      "required": [
        "ref"
      ],
      "additionalProperties": false
    },
    "vouch": {
      "description": "People only, for a list: true to say everyone on it already deals with the sender. An agent leaves it out.",
      "type": "boolean"
    },
    "split_days": {
      "description": "People only, for a list in live mode: when today's print run is full, print what fits today and the rest the next day.",
      "type": "boolean"
    },
    "post_on": {
      "description": "Only when the quote had no post_on: the posting day, YYYY-MM-DD. A different day from the quote's is refused: quote again.",
      "type": "string",
      "format": "date",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
    }
  },
  "required": [
    "quote"
  ],
  "additionalProperties": false
}

Over MCP the tool also takes idempotency_key (required), the same key REST takes in the header.

Output

{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "answer": {
          "type": "string",
          "const": "yes",
          "description": "A not-yet or yes-later answer comes back in the refusal shape."
        },
        "letter": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "const": "queued"
        },
        "money": {
          "type": "object",
          "properties": {
            "held": {
              "type": "object",
              "properties": {
                "credits": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Whole credits. 1 credit is 10p."
                },
                "gbp": {
                  "type": "string",
                  "pattern": "^-?\\d+\\.\\d{2}$",
                  "description": "The same amount in pounds, ex VAT, as a decimal string."
                }
              },
              "required": [
                "credits",
                "gbp"
              ],
              "additionalProperties": false,
              "description": "An amount in credits, with pounds beside it."
            },
            "say": {
              "type": "string",
              "description": "A sentence to repeat to your person as it stands."
            }
          },
          "required": [
            "held",
            "say"
          ],
          "additionalProperties": false
        },
        "posting": {
          "type": "object",
          "properties": {
            "posts_on": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The UK date it will be posted."
            },
            "cutoff_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "says": {
              "type": "string",
              "description": "A sentence to repeat to your person as it stands."
            }
          },
          "required": [
            "posts_on",
            "cutoff_at",
            "says"
          ],
          "additionalProperties": false
        },
        "next": {
          "type": "string"
        }
      },
      "required": [
        "answer",
        "letter",
        "status",
        "money",
        "posting",
        "next"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "answer": {
          "type": "string",
          "const": "yes",
          "description": "A not-yet or yes-later answer comes back in the refusal shape, with details.group."
        },
        "group": {
          "type": "string",
          "description": "The group, grp_…: read it with get_letter."
        },
        "status": {
          "type": "string",
          "const": "queued"
        },
        "letters": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "n": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "letter": {
                "type": "string"
              },
              "to": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "quoted",
                  "waiting_for_approval",
                  "queued",
                  "printing",
                  "printed",
                  "posted",
                  "on_record",
                  "declined",
                  "lapsed",
                  "cancelled",
                  "held",
                  "failed",
                  "returned"
                ]
              }
            },
            "required": [
              "n",
              "letter",
              "to",
              "status"
            ],
            "additionalProperties": false
          },
          "description": "Every letter of the group, in your order."
        },
        "money": {
          "type": "object",
          "properties": {
            "held": {
              "type": "object",
              "properties": {
                "credits": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991,
                  "description": "Whole credits. 1 credit is 10p."
                },
                "gbp": {
                  "type": "string",
                  "pattern": "^-?\\d+\\.\\d{2}$",
                  "description": "The same amount in pounds, ex VAT, as a decimal string."
                }
              },
              "required": [
                "credits",
                "gbp"
              ],
              "additionalProperties": false,
              "description": "An amount in credits, with pounds beside it."
            },
            "say": {
              "type": "string",
              "description": "A sentence to repeat to your person as it stands."
            }
          },
          "required": [
            "held",
            "say"
          ],
          "additionalProperties": false
        },
        "posting": {
          "type": "object",
          "properties": {
            "posts_on": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The UK date it will be posted."
            },
            "cutoff_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "says": {
              "type": "string",
              "description": "A sentence to repeat to your person as it stands."
            }
          },
          "required": [
            "posts_on",
            "cutoff_at",
            "says"
          ],
          "additionalProperties": false
        },
        "next": {
          "type": "string"
        }
      },
      "required": [
        "answer",
        "group",
        "status",
        "letters",
        "money",
        "posting",
        "next"
      ],
      "additionalProperties": false
    }
  ]
}

Refusals

Every refusal has the same shape. Branch on code, answer and retry; repeat say to your person.

CodeAnswerRetryHTTPWhat to do next
key_missingnoafter_fix401Send the key as "Authorization: Bearer as_test_…". Ask your person if you have none.
key_not_validnonever401Ask your person for a new key. There is no link: we cannot say whose it was.
scope_missingnoafter_person403Ask your person to give the key that permission.
invalid_requestnoafter_fix400Fix the field named in details.field. The same idempotency key is fine.
rate_limitednoat_time429Wait. The same idempotency key never sends twice.
try_again_shortlynoat_time503Try again after retry_after with the same idempotency key.
account_expirednonever401Start again with start_account if your person still wants this.
connection_endednoafter_person401Tell your person. To carry on, they connect Atomside again in your assistant.
idempotency_key_reusednoafter_fix409Check first: the earlier call may be the one you meant. Otherwise use a new key.
request_in_progressnoat_time409Wait, then repeat the same call with the same key. You will get its answer.
quote_not_foundnoafter_fix404Check the id, or quote again with quote_letter.
quote_expirednoafter_fix422Quote again and send that. The same idempotency key is fine.
quote_already_usednonever409That is your letter. Read it with get_letter.
mode_mismatchnoafter_fix422Quote again with the right key. A test quote never prints.
needs_approvalnot_yetnot_needed202Do not resend. Show details.show_to_person, then call wait_for_approval.
possible_duplicatenot_yetnot_needed202Do not send it again. Pass on the link: a person decides, even on autopilot.
paused_same_textnot_yetnot_needed202Do not resend or reword it. Pass on the link. Nothing more goes until a person resumes you.
paused_failed_lettersnot_yetnot_needed202Do not resend. Pass on the link. Read why the letters failed with get_letter.
waiting_for_creditnot_yetnot_needed202Pass on the link. It goes by itself if credits arrive before the quote runs out. details.auto_top_up says whether a pack is being bought; sending again buys nothing.
held_for_checknot_yetnot_needed202Do not resend or reword it. Questions go to your person.
prints_lateryes_laternot_needed202Nothing to do.
print_queue_fullnoat_time503Try after retry_after, or tell your person if the date matters.
over_daily_limitnoat_time403Pass on the link, or try again after retry_after. Autopilot only.
over_monthly_limitnoat_time403Pass on the link, or try again after retry_after. Autopilot only.
over_per_letter_limitnoafter_person403Pass on the link. Shorten it only if the wording may change.
over_recipient_limitnoat_time403Pass on the link, or try again after retry_after. Autopilot only.
outside_agent_rulesnoafter_person403Quote again inside the agent rules if that will do, or pass on the link.
customer_over_limitnoat_time403Pass on the link, or try again after retry_after. Autopilot only.
customer_pausednoafter_person403Do not retry. Tell your person; only they can resume this customer.
customer_sender_unverifiednot_yetnot_needed202Do not send it again. Tell your person to ask the customer to look out for a letter from Atomside, or send from your own sender with until_verified: platform_sender.
customer_suspendednoafter_person403Do not retry. Tell the person you are working for.
customer_closednonever409Do not retry. Make a new customer with a new ref if your person wants to write again.
customer_limit_reachednoafter_person403Do not retry now. Send letters for the customers you have; get_account shows when the limit is lifted.
test_customer_in_livenoafter_fix422Use a test key, or a ref that does not start cust_test_.
customer_ref_not_validnoafter_fix422Use your own id for the customer, not an email, name or postcode.
customer_ref_not_allowednoafter_person403Check the reference. If it is new and right, ask your person to allow it.
on_behalf_of_requirednoafter_fix422Quote again with on_behalf_of.ref set to your own id for the customer.
origin_requirednoafter_fix422Quote again with origin: the run, the software and who asked.
agent_pausednoafter_person403Do not retry. Pass on the link. Check get_account later.
sending_stoppednoafter_person403Do not retry. Tell the person you are working for.
account_suspendednoafter_person403Do not retry. Tell the person you are working for.
not_ready_for_livenoafter_person403Pass on the link to finish going live. Test mode still works.
key_cannot_sendnoafter_person403Give your person the quote to send, or the link to the key.
unclaimed_limit_reachednoafter_person403Pass on tell_your_person from start_account, or new_claim_link. Claiming lifts the limit.
unclaimed_hourly_limitnoat_time429Try again after retry_after. Claiming the account lifts the limit.
address_on_do_not_writenoafter_person403Tell your person. Only they can take it off the list.
new_account_daily_limitnoat_time429Try again after retry_after, or tell your person if it cannot wait. The limit ends 30 days after the account went live (details.new_until).
post_on_not_availablenoafter_fix422Ask your person before you pick another day: details.day_before and details.day_after are the nearest days that work (changes_day). Leave post_on out to go at the next cut-off. For differs_from_quote, quote again with the new day.
not_foundnoafter_fix404Check the name against the tool list or /v1/openapi.json.