Add a customer: create_customer
Adds a customer you send letters for, by your own ref. relationship says how it stands to you: own_letters (the letters are its own, from its own sender, which we confirm by a code we post to it) or platform_name (letters go in your name). A ref a letter already named is declared, keeping its letters. Free.
| MCP tool | None: it manages your customers, so it is kept out of the tools an agent reads. Use REST, the CLI or the SDK. |
| REST | POST /v1/customers |
| CLI | atomside create-customer |
| Key needs | Manage customers (customers:manage) |
| Changes anything | Yes. |
| Idempotency key | Required: the Idempotency-Key header over REST, --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/customers \
-H "Authorization: Bearer $ATOMSIDE_API_KEY" \
-H "Idempotency-Key: add-harbour-view" \
-H "Content-Type: application/json" \
-d '{
"ref": "cust_2201",
"name": "Harbour View Lettings",
"relationship": "platform_name",
"contact_email": "[email protected]",
"limits": {
"per_day_letters": 50,
"per_month_credits": 20000,
"over_limit": "ask"
}
}'
CLI:
atomside create-customer \
--ref cust_2201 \
--name 'Harbour View Lettings' \
--relationship platform_name \
--contact-email [email protected] \
--limits '{"per_day_letters":50,"per_month_credits":20000,"over_limit":"ask"}' \
--idempotency-key add-harbour-view
The answer (HTTP 200):
{
"id": "cus_example000000001",
"ref": "cust_2201",
"name": "Harbour View Lettings",
"relationship": "platform_name",
"state": "sending",
"until_verified": "hold",
"contact_email": "[email protected]",
"sender": null,
"limits": {
"per_day_letters": 50,
"per_day_credits": null,
"per_month_letters": null,
"per_month_credits": 20000,
"over_limit": "ask",
"per_recipient": null,
"applies": [
"50 letters a day",
"20,000 credits a month"
]
},
"used": {
"today": {
"letters": 0,
"credits": 0
},
"month": {
"letters": 0,
"credits": 0
}
},
"held_letters": 0,
"created_via": "api",
"created_at": "2026-11-16T09:30:00.000Z",
"paused_at": null,
"suspended": null,
"close_requested_at": null,
"closed_at": null,
"test": false
}
Input
Over REST, fields in the path go in the path, GET fields in the query string, and POST fields in the JSON body.
{
"type": "object",
"properties": {
"ref": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Your ref for the customer: letters, digits and . _ : - only, up to 64."
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "The customer's name."
},
"relationship": {
"type": "string",
"enum": [
"own_letters",
"platform_name",
"collects_debts"
],
"description": "collects_debts is always refused: Atomside does not send letters that collect debts."
},
"sender": {
"description": "Its own sender. Needed for own_letters, refused otherwise.",
"type": "object",
"properties": {
"name": {
"type": "string",
"maxLength": 100
},
"line1": {
"type": "string",
"maxLength": 100
},
"line2": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
]
},
"town": {
"type": "string",
"maxLength": 60
},
"postcode": {
"type": "string",
"maxLength": 10
}
},
"required": [
"name",
"line1",
"town",
"postcode"
],
"additionalProperties": false
},
"contact_email": {
"anyOf": [
{
"type": "string",
"maxLength": 254
},
{
"type": "null"
}
],
"description": "Where we may write to the customer about its sender. Never used for marketing."
},
"until_verified": {
"type": "string",
"enum": [
"hold",
"platform_sender"
],
"description": "What its letters do before its sender is confirmed: wait (hold), or go from your own sender (platform_sender)."
},
"limits": {
"type": "object",
"properties": {
"per_day_letters": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
{
"type": "null"
}
]
},
"per_day_credits": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
{
"type": "null"
}
]
},
"per_month_letters": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
{
"type": "null"
}
]
},
"per_month_credits": {
"anyOf": [
{
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
{
"type": "null"
}
]
},
"over_limit": {
"description": "Over a limit: the letter waits for a person (ask), or is refused (refuse).",
"type": "string",
"enum": [
"ask",
"refuse"
]
},
"per_recipient": {
"description": "Letters for this customer to one person, in so many days. Replaces the agent's.",
"anyOf": [
{
"type": "object",
"properties": {
"letters": {
"type": "integer",
"minimum": 1,
"maximum": 1000000
},
"per_days": {
"type": "integer",
"minimum": 1,
"maximum": 90
}
},
"required": [
"letters",
"per_days"
],
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
}
},
"required": [
"ref",
"name",
"relationship"
],
"additionalProperties": false
}
Output
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "The customer (cus_…)."
},
"ref": {
"type": "string",
"description": "Your ref for the customer."
},
"name": {
"type": [
"string",
"null"
]
},
"relationship": {
"anyOf": [
{
"type": "string",
"enum": [
"own_letters",
"platform_name"
]
},
{
"type": "null"
}
],
"description": "Null for a customer only ever named on a letter, never declared."
},
"state": {
"type": "string",
"enum": [
"sending",
"sending_platform_sender",
"waiting_on_sender",
"held",
"paused",
"suspended",
"closed"
]
},
"until_verified": {
"type": "string",
"enum": [
"hold",
"platform_sender"
]
},
"contact_email": {
"type": [
"string",
"null"
]
},
"sender": {
"anyOf": [
{
"type": "object",
"properties": {
"state": {
"type": "string",
"enum": [
"being_checked",
"not_accepted",
"code_posted",
"verified"
]
},
"name": {
"type": "string"
},
"address_line": {
"type": "string",
"description": "The address on one line, as it prints."
},
"posted_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"
}
]
},
"expires_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"
}
]
},
"attempts_left": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"letters_sent": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"verified_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"
}
]
}
},
"required": [
"state",
"name",
"address_line",
"posted_at",
"expires_at",
"attempts_left",
"letters_sent",
"verified_at"
],
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "Null for a customer that has no sender of its own."
},
"limits": {
"type": "object",
"properties": {
"per_day_letters": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"per_day_credits": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"per_month_letters": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"per_month_credits": {
"anyOf": [
{
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
{
"type": "null"
}
]
},
"over_limit": {
"type": "string",
"enum": [
"ask",
"refuse"
]
},
"per_recipient": {
"anyOf": [
{
"type": "object",
"properties": {
"letters": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"per_days": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"letters",
"per_days"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"applies": {
"type": "array",
"items": {
"type": "string"
},
"description": "The limits that apply to the next letter, in words, customer first."
}
},
"required": [
"per_day_letters",
"per_day_credits",
"per_month_letters",
"per_month_credits",
"over_limit",
"per_recipient",
"applies"
],
"additionalProperties": false
},
"used": {
"type": "object",
"properties": {
"today": {
"type": "object",
"properties": {
"letters": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"credits": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"letters",
"credits"
],
"additionalProperties": false
},
"month": {
"type": "object",
"properties": {
"letters": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"credits": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"letters",
"credits"
],
"additionalProperties": false
}
},
"required": [
"today",
"month"
],
"additionalProperties": false
},
"held_letters": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"created_via": {
"type": "string",
"enum": [
"letter",
"api",
"console",
"import",
"test"
]
},
"created_at": {
"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))$"
},
"paused_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"
}
]
},
"suspended": {
"anyOf": [
{
"type": "object",
"properties": {
"at": {
"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))$"
},
"reason": {
"type": "string"
}
},
"required": [
"at",
"reason"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"close_requested_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"
}
]
},
"closed_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"
}
]
},
"test": {
"type": "boolean",
"description": "True for a test customer (cust_test_…), which always does one thing."
}
},
"required": [
"id",
"ref",
"name",
"relationship",
"state",
"until_verified",
"contact_email",
"sender",
"limits",
"used",
"held_letters",
"created_via",
"created_at",
"paused_at",
"suspended",
"close_requested_at",
"closed_at",
"test"
],
"additionalProperties": false
}
Refusals
Every refusal has the same shape. Branch on code, answer and retry; repeat say to your person.
| Code | Answer | Retry | HTTP | What to do next |
|---|---|---|---|---|
key_missing | no | after_fix | 401 | Send the key as "Authorization: Bearer as_test_…". Ask your person if you have none. |
key_not_valid | no | never | 401 | Ask your person for a new key. There is no link: we cannot say whose it was. |
scope_missing | no | after_person | 403 | Ask your person to give the key that permission. |
invalid_request | no | after_fix | 400 | Fix the field named in details.field. The same idempotency key is fine. |
rate_limited | no | at_time | 429 | Wait. The same idempotency key never sends twice. |
try_again_shortly | no | at_time | 503 | Try again after retry_after with the same idempotency key. |
account_expired | no | never | 401 | Start again with start_account if your person still wants this. |
connection_ended | no | after_person | 401 | Tell your person. To carry on, they connect Atomside again in your assistant. |
idempotency_key_reused | no | after_fix | 409 | Check first: the earlier call may be the one you meant. Otherwise use a new key. |
request_in_progress | no | at_time | 409 | Wait, then repeat the same call with the same key. You will get its answer. |
customer_exists | no | after_fix | 409 | Use update_customer, or a new ref. A closed customer keeps its ref. |
customer_ref_not_valid | no | after_fix | 422 | Use your own id for the customer, not an email, name or postcode. |
customer_relationship_not_allowed | no | never | 422 | Do not retry this. For a sender, the customer must send its own letters (own_letters). |
sender_required | no | after_fix | 422 | Add sender (name, line1, town, postcode), or make the customer platform_name. |
address_not_found | no | after_fix | 422 | Use one of details.matches only if it is clearly the same place. |
customer_limit_reached | no | after_person | 403 | Do not retry now. Send letters for the customers you have; get_account shows when the limit is lifted. |
test_customer_in_live | no | after_fix | 422 | Use a test key, or a ref that does not start cust_test_. |
test_customer_fixed | no | never | 409 | Make your own test customer to change, or use this one as it is. |