mail

PUT /v1/mail/services/{mailServiceId}/spam-settings

Save the domain's spam settings.

All mail endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

Authentication

Send an API key as a bearer token. The key must carry the mail.manage permission; a key without it is refused with 403, not 404.

This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.

curl -X PUT https://api.zinndigital.com/v1/mail/services/{mailServiceId}/spam-settings \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "allow": <string[]>, "block": <string[]>, "junk": <boolean> }'

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console

Details

Replaces both lists and the junk policy, and applies them to every mailbox on the domain (a mailbox created later inherits them). A blocked sender's mail goes to the Junk folder and is never forwarded or auto-replied to; an allowed sender's mail goes to the inbox even when its spam score says Junk, unless the sender's domain publishes a reject or quarantine DMARC policy and the message failed it, or the message passed none of SPF, DKIM and DMARC (a forged allowed sender stays in Junk); junk: false keeps all mail in the inbox. A message addressed to mailboxes on more than one domain is judged by the spam score alone. Entries are addresses (friend@example.com) or whole domains (example.com), at most 500 per list, and a sender cannot be in both lists. The settings are stored only after the mail server took them. Requires mail.manage.

Parameters

NameTypeRequiredWhat it is
mailServiceId (path)UuidYesEmail service ID (UUIDv7).

Request body

NameTypeRequiredWhat it is
allowstring[]YesSenders always delivered to the inbox (addresses or whole domains).
blockstring[]YesSenders always filed into Junk (addresses or whole domains).
junkbooleanYesWhen false, mail the spam filter scores as spam stays in the inbox.
appliedbooleanNoFalse while at least one mailbox on the domain does not carry these settings yet (a new mailbox failed to take them). Retried hourly and staff are alerted; saving again also…
notAppliedSinceobjectNoWhen applying the settings to a mailbox first failed; null when applied.

Response

NameTypeRequiredWhat it is
allowstring[]YesSenders always delivered to the inbox (addresses or whole domains).
blockstring[]YesSenders always filed into Junk (addresses or whole domains).
junkbooleanYesWhen false, mail the spam filter scores as spam stays in the inbox.
appliedbooleanNoFalse while at least one mailbox on the domain does not carry these settings yet (a new mailbox failed to take them). Retried hourly and staff are alerted; saving again also…
notAppliedSinceobjectNoWhen applying the settings to a mailbox first failed; null when applied.

Errors this endpoint can return

401 · 403 · 404 · 422 · 429 · 503