Mailprotector Customers & Domains
Overview
Customers are the client organizations under the MSP's reseller; domains
hang off customers and carry the actual mail routing. Onboarding a client
is: create the customer, create the domain, verify it, then point mail
flow at it (destinations for inbound delivery, sources for outbound
authorization).
Key Concepts
| Concept |
Detail |
| Customer |
{id, name, provider, reseller, created_at, updated_at} — created with just name and contact email |
| Domain status |
domain_status: {id: 1, name: "Pending"} or {id: 2, name: "Active"} |
verification_token |
Returned on domain create while Pending; null once Active |
| Domain alias |
A domain with parent set to the primary domain; goes through its own Pending/verification |
address_discovery_enabled |
Domain flag; auto-discovers addresses from mail flow (defaults on for new domains) |
| Email destination |
Where filtered inbound mail is delivered — domain, hostname, or IP, with priority ordering |
| Email source |
An IP authorized to relay outbound mail through Mailprotector |
Common Workflows
Customer lifecycle
- Create:
POST /resellers/{reseller_id}/customers with
{"name": "...", "email": "contact@..."} → 201 with the new id
(tool: mailprotector_customers_create).
- Read:
mailprotector_customers_list (from the bound reseller) and
mailprotector_customers_get.
- Edit:
PUT /customers/{customer_id} with name/email (via
mailprotector_execute_tool).
- Delete:
DELETE /customers/{customer_id} — removes all domains and
users under the customer. Irreversible; confirm explicitly.
Domain creation and verification
POST /customers/{customer_id}/domains with {"name": "domain.com"}
(tool: mailprotector_domains_create).
- The response is 201 with
domain_status Pending and a
verification_token. Mail is not filtered for a Pending domain.
- Surface the
verification_token to the operator — ownership is
proven with it before Mailprotector activates the domain. Re-fetch
the domain (mailprotector_domains_get) to watch for
domain_status id 2 (Active) / verification_token: null.
- After activation, add email destinations and sources (below), then
repoint MX records.
Domain aliases
POST /domains/{domain_id}/aliases with {"name": "domain-alias.com"}.
The alias appears in GET /domains/{domain_id}/aliases with parent
set to the primary domain and its own Pending status + token. Every user
under the primary domain automatically accepts mail at the alias domain
(user email_addresses extend to each alias), so create aliases before
bulk-creating users when you want alias addresses generated.
Moving a domain between customers
POST /domains/{domain_id}/move with {"customer_id": 16998} — only
within the same reseller. User groups, users, and rules travel with
the domain. Use this to fix a domain created under the wrong customer
instead of delete + recreate (which would destroy users).
Mail routing
- Destinations:
GET/POST /domains/{domain_id}/email_destinations
with {"address": "mail.domain.com"} — address may be a domain,
hostname, or IP. priority is assigned in creation order (0 first);
lower priority is tried first.
- Sources:
GET/POST /domains/{domain_id}/email_sources with
{"address": "192.0.2.1"} — the IPs allowed to relay outbound.
- Both also exist at user-group scope
(
/user_groups/{id}/email_destinations and _sources) for groups
that deliver somewhere other than the domain default — the MCP tool
takes scope: domain|user_group.
Gotchas
- Pending domains silently drop the onboarding. Everything after
domain creation (groups, users, MX cutover) can proceed, but no mail
is filtered until the domain is verified. Always report the
verification state, and never call an onboarding done while
domain_status is Pending.
- Customer delete cascades. Domains and users go with it. Prefer
domain move or user-group edits for restructuring.
PUT /domains/{domain_id} is for flags like
address_discovery_enabled — you cannot rename a domain; create the
correct one and move users.
- Customer managers (
POST /customers/{customer_id}/managers)
create console logins, but roles cannot be assigned via the API —
a new manager has an empty roles array until someone assigns the
role in the console. Listing customer managers excludes
reseller-level managers.
- Statements (
GET /resellers/{id}/statements,
GET /customers/{id}/statements) are billing history
(amount, currency, statement_status, billing/due dates) — read
them for reconciliation, not for provisioning state.
Related Skills
1---2name: mailprotector-customers-domains3description: Customer lifecycle (create/edit/delete under the reseller), domain creation with the Pending → Active verification flow and verification_token, domain aliases, moving domains between customers, address discovery, and mail routing via email destinations and email sources.4---56# Mailprotector Customers & Domains78## Overview910Customers are the client organizations under the MSP's reseller; domains11hang off customers and carry the actual mail routing. Onboarding a client12is: create the customer, create the domain, verify it, then point mail13flow at it (destinations for inbound delivery, sources for outbound14authorization).1516## Key Concepts1718| Concept | Detail |19|---------|--------|20| Customer | `{id, name, provider, reseller, created_at, updated_at}` — created with just `name` and contact `email` |21| Domain status | `domain_status`: `{id: 1, name: "Pending"}` or `{id: 2, name: "Active"}` |22| `verification_token` | Returned on domain create while Pending; `null` once Active |23| Domain alias | A domain with `parent` set to the primary domain; goes through its own Pending/verification |24| `address_discovery_enabled` | Domain flag; auto-discovers addresses from mail flow (defaults on for new domains) |25| Email destination | Where filtered inbound mail is delivered — domain, hostname, or IP, with `priority` ordering |26| Email source | An IP authorized to relay outbound mail through Mailprotector |2728## Common Workflows2930### Customer lifecycle31321. Create: `POST /resellers/{reseller_id}/customers` with33 `{"name": "...", "email": "contact@..."}` → 201 with the new `id`34 (tool: `mailprotector_customers_create`).352. Read: `mailprotector_customers_list` (from the bound reseller) and36 `mailprotector_customers_get`.373. Edit: `PUT /customers/{customer_id}` with `name`/`email` (via38 `mailprotector_execute_tool`).394. Delete: `DELETE /customers/{customer_id}` — **removes all domains and40 users under the customer**. Irreversible; confirm explicitly.4142### Domain creation and verification43441. `POST /customers/{customer_id}/domains` with `{"name": "domain.com"}`45 (tool: `mailprotector_domains_create`).462. The response is 201 with `domain_status` **Pending** and a47 `verification_token`. Mail is **not filtered** for a Pending domain.483. Surface the `verification_token` to the operator — ownership is49 proven with it before Mailprotector activates the domain. Re-fetch50 the domain (`mailprotector_domains_get`) to watch for51 `domain_status` id 2 (Active) / `verification_token: null`.524. After activation, add email destinations and sources (below), then53 repoint MX records.5455### Domain aliases5657`POST /domains/{domain_id}/aliases` with `{"name": "domain-alias.com"}`.58The alias appears in `GET /domains/{domain_id}/aliases` with `parent`59set to the primary domain and its own Pending status + token. Every user60under the primary domain automatically accepts mail at the alias domain61(user `email_addresses` extend to each alias), so create aliases before62bulk-creating users when you want alias addresses generated.6364### Moving a domain between customers6566`POST /domains/{domain_id}/move` with `{"customer_id": 16998}` — only67within the **same reseller**. User groups, users, and rules travel with68the domain. Use this to fix a domain created under the wrong customer69instead of delete + recreate (which would destroy users).7071### Mail routing7273- Destinations: `GET`/`POST /domains/{domain_id}/email_destinations`74 with `{"address": "mail.domain.com"}` — address may be a domain,75 hostname, or IP. `priority` is assigned in creation order (0 first);76 lower priority is tried first.77- Sources: `GET`/`POST /domains/{domain_id}/email_sources` with78 `{"address": "192.0.2.1"}` — the IPs allowed to relay outbound.79- Both also exist at user-group scope80 (`/user_groups/{id}/email_destinations` and `_sources`) for groups81 that deliver somewhere other than the domain default — the MCP tool82 takes `scope: domain|user_group`.8384## Gotchas8586- **Pending domains silently drop the onboarding.** Everything after87 domain creation (groups, users, MX cutover) can proceed, but no mail88 is filtered until the domain is verified. Always report the89 verification state, and never call an onboarding done while90 `domain_status` is Pending.91- **Customer delete cascades.** Domains and users go with it. Prefer92 domain move or user-group edits for restructuring.93- **`PUT /domains/{domain_id}`** is for flags like94 `address_discovery_enabled` — you cannot rename a domain; create the95 correct one and move users.96- **Customer managers** (`POST /customers/{customer_id}/managers`)97 create console logins, but **roles cannot be assigned via the API** —98 a new manager has an empty `roles` array until someone assigns the99 role in the console. Listing customer managers excludes100 reseller-level managers.101- **Statements** (`GET /resellers/{id}/statements`,102 `GET /customers/{id}/statements`) are billing history103 (`amount`, `currency`, `statement_status`, billing/due dates) — read104 them for reconciliation, not for provisioning state.105106## Related Skills107108- [users-and-groups](../users-and-groups/SKILL.md) — the next onboarding step after the domain is Active109- [api-patterns](../api-patterns/SKILL.md) — hierarchy, auth, and error handling