Add domain
add_domainClaim a domain you own (mode byod) and start onboarding (202 pending, follow meta.poll). On the Free plan, you can claim one free Mailrun subdomain and one root domain the user already owns. Use check_free_subdomain to find a free subdomain, then claim it without redirect_to or an active parent on the account. For the root domain, ask the user to point its nameservers at Mailrun. A second domain of their own returns domain_limit_reached (details.kind custom). A subdomain of their own domain needs its parent active on the account, so it would use a second domain slot and is refused on Free. Add no more than 3 domains the user owns in any 30 days. Further claims return domain_limit_reached (details.kind custom_claims). Retry after details.available_at or upgrade. Before calling, ask the user where visitors to the bare domain should be redirected (redirect_to); if omitted a placeholder is used. Supply sender_first_name, sender_last_name and email_address together or not at all; omit all three to onboard with no mailbox and create the first address later with create_identity or attach_identity_email. A subdomain (e.g. agent.example.com) requires its parent domain to be active on this account first (otherwise parent_domain_required) and never needs a nameserver change: never tell the user to update nameservers or add NS records for it. Replays: the same idempotency_key with the exact same field set replays; unknown fields are rejected, not dropped. Domain purchase is not available.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"idempotency_key": "<idempotency_key>",
"domain": "<domain>"
},
"name": "add_domain"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | byod is supported (null also means byod); purchase answers domain_purchase_unavailable. | byod |
| domain | Yes | ||
| redirect_to | No | Where visitors to the bare domain are redirected: an https URL (a bare host like example.com means https), with no empty, . or .. path segments. Every visitor lands on exactly this URL. Ask the user for it; when omitted a placeholder is set. | |
| email_address | No | Enrollment sender address on this domain. | |
| idempotency_key | Yes | Stable key you choose (max 64 chars); reuse it on retry. A different payload under the same key is refused with idempotency_conflict. | |
| sender_last_name | No | ||
| sender_first_name | No |