Skip to content
MailMarcodocs

10 · MailMarco API

Mailboxes

Real mailboxes your customers log into — IMAP, SMTP, calendar and contacts — provisioned through the API.


The model

Four resources, in the order you create them. Each one only makes sense once the one above it exists.

ResourceWhat it is
mailbox-domainA domain whose MX points at MailMarco, so mail for it lands here. Must be verified before it can hold mailboxes.
mailboxAn account with a password, a quota and a message store. This is the thing a person logs into.
aliasA second address that delivers into an existing mailbox. No password, no quota of its own.
forwarderA rule that sends arriving mail on to an external address, with or without keeping a copy.

Hosting domains

Adding a domain returns the MX record to publish. Nothing can be created inside it until verification sees that record in DNS.

POST/v1/mailbox-domains
auth: Session201 on success

Register a hosting domain and get its MX record.

Body

domain
stringrequired
Lower-cased and trimmed. Same grammar as a sending domain.
request
curl -X POST https://api.mailmarco.com/v1/mailbox-domains \
  -H "authorization: Bearer $MAILMARCO_ACCESS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"domain":"mail.example.com"}'
response · 201
{
  "id": "9a1b2c3d-4e5f-4061-8273-8495a6b7c8d9",
  "domain": "mail.example.com",
  "status": "pending",
  "mxHost": "mail.mailmarco.com",
  "mxPriority": 10,
  "catchAllMailboxId": null,
  "verifiedAt": null,
  "dnsRecord": {
    "host": "mail.example.com",
    "recordType": "MX",
    "value": "10 mail.mailmarco.com",
    "ttl": 3600
  }
}
POST/v1/mailbox-domains/:id/verify
auth: Session200 on success

Re-check DNS and flip the domain to verified.

Path parameters

id
uuidrequired
The domain id.
response · 200
{ "id": "9a1b2c3d-…", "status": "verified", "verifiedAt": "2026-07-31T09:12:44.000Z" }

DNS caches. A record published seconds ago may not be visible yet, and the answer is to wait and call verify again rather than to re-create the domain.

Catch-all

A catch-all points every address in the domain that matches nothing else at one mailbox. It is off by default, because a catch-all receives every typo and every dictionary attack aimed at the domain.

PATCH/v1/mailbox-domains/:id/catch-all
auth: Session200 on success

Set or clear the catch-all mailbox.

Body

catchAllMailboxId
uuid | nullrequired
A mailbox in this domain, or null to clear it.

Mailboxes

POST/v1/mailboxes
auth: Session201 on success

Provision a mailbox. The plaintext password is in the response and never again.

Body

mailboxDomainId
uuidrequired
Must be a VERIFIED hosting domain.
localPart
stringrequired
The part before the @. Lower-cased; letters, digits and . _ + - only.
password
stringrequired
12–256 characters. See the note below on why the bar is higher here.
displayName
stringoptionaldefault ""
Up to 200 chars.
quotaBytes
integeroptionaldefault 1073741824
1 GiB by default. 0 means unlimited. Maximum 1 TiB.
request
curl -X POST https://api.mailmarco.com/v1/mailboxes \
  -H "authorization: Bearer $MAILMARCO_ACCESS_TOKEN" \
  -H "content-type: application/json" \
  -d '{
    "mailboxDomainId": "9a1b2c3d-4e5f-4061-8273-8495a6b7c8d9",
    "localPart": "info",
    "displayName": "Info Desk",
    "password": "correct-horse-battery-staple"
  }'
response · 201
{
  "id": "1f2e3d4c-5b6a-4978-8695-a4b3c2d1e0f9",
  "address": "[email protected]",
  "displayName": "Info Desk",
  "quotaBytes": 1073741824,
  "status": "active",
  "provisioned": true,
  "password": "correct-horse-battery-staple"
}

Mailbox passwords have a higher minimum than dashboard passwords (12 characters) because they are typed into third-party mail clients and used over IMAP and SMTP, where there is no MFA, no session concept and no rate-limit UI. A compromise hands over the whole mail history and an authenticated relay.

provisioned is not decoration

A mailbox exists in two places: a record here and an account in the mail server itself. If the second write fails, provisioned is false and syncError carries the reason — the address will not accept mail yet. Reconciliation retries it; a mailbox that stays unprovisioned is a fault to surface, not a state to hide.

Delete, restore, purge

Deleting is reversible for 30 days. Purging is not, and is refused until the recovery window has elapsed — there is no force flag, so no single call can go from a live mailbox to destroyed mail.

CallEffect
DELETE /v1/mailboxes/:idLogins stop. Mail is untouched. Sets purgeAfter 30 days out.
POST /v1/mailboxes/:id/restoreUndoes the above, within the window.
DELETE /v1/mailboxes/:id/purgeIRREVERSIBLE. Destroys the account and every message. 409 before the window elapses.

Aliases

An alias is another address that delivers into an existing mailbox. Only the local part is accepted: the domain is taken from the target mailbox, so an alias can only ever be minted inside a domain you have already proven you own.

POST/v1/aliases
auth: Session201 on success

Add an alias to a mailbox.

Body

mailboxId
uuidrequired
The target mailbox.
localPart
stringrequired
Same grammar as a mailbox local part. The domain is not accepted.
response · 201
{ "id": "…", "mailboxId": "1f2e3d4c-…", "address": "[email protected]" }

Forwarding

A forwarder sends arriving mail on to an external address. The one decision that matters is whether a copy stays behind.

keepCopyBehaviour
trueDefault. The message is forwarded AND stored in the mailbox. The mailbox keeps consuming quota.
falseForward only. The message is not stored here at all — if the destination rejects it, the mail is gone.
POST/v1/forwarders
auth: Session201 on success

Forward a mailbox's mail to an external address.

Body

mailboxId
uuidrequired
The source mailbox.
destination
stringrequired
An external email address, up to 320 characters.
keepCopy
booleanoptionaldefault true
Whether the message also stays in the mailbox.
response · 201
{
  "id": "…",
  "mailboxId": "1f2e3d4c-…",
  "destination": "[email protected]",
  "keepCopy": true,
  "enabled": true,
  "status": "active"
}

PATCH /v1/forwarders/:id toggles enabled or keepCopy; DELETE /v1/forwarders/:id removes the rule.

Connecting a client

Mailboxes are reached with standard protocols, so any mail, calendar or contacts client works. The dashboard shows these per mailbox with copy buttons; the values are below for reference. The username is always the full address.

ProtocolHostPortSecurity
IMAPmail.mailmarco.com993SSL/TLS
IMAP (STARTTLS)mail.mailmarco.com143STARTTLS
SMTP submissionmail.mailmarco.com465SSL/TLS

Calendar and contacts

Every mailbox gets a calendar and an address book when it is created. Most clients need only the server URL and will discover the rest; the direct collection URLs are there for clients that ask for a collection address.

client settings
Server URL      https://mail.mailmarco.com/
Username        [email protected]

CalDAV  (direct) https://mail.mailmarco.com/dav/cal/info%40mail.example.com/default/
CardDAV (direct) https://mail.mailmarco.com/dav/card/info%40mail.example.com/default/

The address is percent-encoded in the path — it contains an @, and un-encoded the URL's authority is ambiguous.

Endpoints

MethodPathPurpose
POST/v1/mailbox-domainsAdd a hosting domain
GET/v1/mailbox-domainsList hosting domains
GET/v1/mailbox-domains/:idRetrieve one
POST/v1/mailbox-domains/:id/verifyRe-check DNS
POST/v1/mailbox-domains/:id/suspendStop accepting mail
PATCH/v1/mailbox-domains/:id/catch-allSet or clear catch-all
DELETE/v1/mailbox-domains/:idRemove a hosting domain
POST/v1/mailboxesProvision a mailbox
GET/v1/mailboxesList mailboxes
GET/v1/mailboxes/:idRetrieve one
PATCH/v1/mailboxes/:idRename, re-quota, suspend, reset password
DELETE/v1/mailboxes/:idSoft-delete (30-day recovery)
POST/v1/mailboxes/:id/restoreUndo a soft-delete
DELETE/v1/mailboxes/:id/purgeDestroy the mailbox and its mail
POST/v1/aliasesAdd an alias
GET/v1/aliases?mailboxId=List aliases
DELETE/v1/aliases/:idRemove an alias
POST/v1/forwardersAdd a forwarding rule
GET/v1/forwarders?mailboxId=List forwarding rules
PATCH/v1/forwarders/:idToggle enabled / keepCopy
DELETE/v1/forwarders/:idRemove a forwarding rule