API: Masking
get_masking
Section titled “get_masking”GET /v1/masking · scope: read · MCP tool: get_masking
Masking status of every domain, and the DNS provider keys on file.
state is one of: off, applying, needs_input (we need DNS access: see needs), pending_ns (nameservers are switching), active, drift (DNS changed underneath us), failed, self_service_pending / _partial / _verified. dns_keys lists the DNS provider keys connected for masking (never the key itself).
curl -X GET "https://api.maildeck.co/v1/masking" \ -H "Authorization: Bearer $MAILDECK_API_KEY"enable_masking
Section titled “enable_masking”POST /v1/masking · scope: write · MCP tool: enable_masking
Turn masking on for domains: they will show the destination website.
Changes DNS for each domain (and may switch its nameservers), so confirm with the person first. Answers at once with state “applying”; follow progress with get_masking. state is one of: off, applying, needs_input (we need DNS access: see needs), pending_ns (nameservers are switching), active, drift (DNS changed underneath us), failed, self_service_pending / _partial / _verified. Per-domain errors: domain_not_found, not_live (inboxes not delivered yet), managed_elsewhere.
| Body field | Type | Required | Notes |
|---|---|---|---|
domains | array of string | yes | Domains from list_domains |
destination | string | yes | The real website to show, e.g. “https://acme.com”. Not one of the sending domains. up to 500 chars |
mode | redirect / mirror / self_service | no | redirect (default) sends visitors to the site; mirror shows it under the sending domain; self_service means the person sets DNS themselves |
keep_in_own_cloudflare | boolean | no | Keep moved domains in the customer’s own Cloudflare account (needs a connected Cloudflare key) |
manual_nameserver_change | boolean | no | The person will switch nameservers by hand instead of us doing it |
idempotency_key | string | yes | Any unique string for this action. Sending the same one again returns the first result instead of repeating the action. up to 200 chars |
confirm | boolean | yes | Must be true. Confirms the person has agreed to this action |
curl -X POST "https://api.maildeck.co/v1/masking" \ -H "Authorization: Bearer $MAILDECK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domains":[],"destination":"…","idempotency_key":"a-unique-string","confirm":true}'disable_masking
Section titled “disable_masking”DELETE /v1/masking · scope: write · MCP tool: disable_masking
Turn masking off for domains and remove the DNS records it added.
| Body field | Type | Required | Notes |
|---|---|---|---|
domains | array of string | yes | |
idempotency_key | string | yes | Any unique string for this action. Sending the same one again returns the first result instead of repeating the action. up to 200 chars |
confirm | boolean | yes | Must be true. Confirms the person has agreed to this action |
curl -X DELETE "https://api.maildeck.co/v1/masking" \ -H "Authorization: Bearer $MAILDECK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domains":[],"idempotency_key":"a-unique-string","confirm":true}'get_masking_guide
Section titled “get_masking_guide”GET /v1/masking/guide · scope: read · MCP tool: get_masking_guide
Which DNS providers masking supports, and exactly which key each one needs.
Per provider: the fields add_masking_credential expects and the steps to create a key with the right permissions. Account passwords and Cloudflare Global API Keys are refused; only scoped API keys are taken.
curl -X GET "https://api.maildeck.co/v1/masking/guide" \ -H "Authorization: Bearer $MAILDECK_API_KEY"add_masking_credential
Section titled “add_masking_credential”POST /v1/masking/credentials · scope: write · MCP tool: add_masking_credential
Connect a DNS provider API key so masking can set DNS records.
For Cloudflare send the scoped API token as token. For Porkbun, Namecheap or GoDaddy send secret with the fields named in get_masking_guide. To reuse a registrar key already given during order setup, send saved_id from get_masking. The key is checked at once and never returned.
| Body field | Type | Required | Notes |
|---|---|---|---|
provider | string | no | cloudflare, porkbun, namecheap or godaddy. up to 40 chars, default "cloudflare" |
token | string | no | Cloudflare scoped API token. up to 2000 chars |
secret | object | no | Provider key fields, as named in get_masking_guide |
saved_id | string | no | Reuse a registrar key saved during setup (saved_registrar_keys in get_masking). up to 80 chars |
domain | string | no | A domain this key is for, so a waiting mask picks it up at once. up to 253 chars |
idempotency_key | string | yes | Any unique string for this action. Sending the same one again returns the first result instead of repeating the action. up to 200 chars |
curl -X POST "https://api.maildeck.co/v1/masking/credentials" \ -H "Authorization: Bearer $MAILDECK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"idempotency_key":"a-unique-string"}'verify_masking
Section titled “verify_masking”POST /v1/masking/verify · scope: write · MCP tool: verify_masking
Ask for masked domains to be re-checked now (after a DNS or nameserver change).
| Body field | Type | Required | Notes |
|---|---|---|---|
domains | array of string | yes | |
idempotency_key | string | yes | Any unique string for this action. Sending the same one again returns the first result instead of repeating the action. up to 200 chars |
curl -X POST "https://api.maildeck.co/v1/masking/verify" \ -H "Authorization: Bearer $MAILDECK_API_KEY" \ -H "Content-Type: application/json" \ -d '{"domains":[],"idempotency_key":"a-unique-string"}'