Block a sender

.md

Refuse mail from an address or a whole domain.

Scopesmail:write
POST/v1/me/mail/blocked-senders

A sender typed in by hand. To block the sender of a message somebody is reading, block from a message instead.

Request

curl -X POST https://api.proppertrading.com/v1/me/mail/blocked-senders \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 5b7d9f1a-3c5e-4a7b-9d1f-2e4a6c8e0b1d" \
  -d '{ "pattern": "amexp.com" }'
FieldDescription
patternAn address, or a domain as amexp.com, @amexp.com or *.amexp.com. All three mean the domain

A domain covers its subdomains too, so amexp.com also refuses news.amexp.com. A bare top level domain such as com is not accepted.

Response

201 with the new entry. A sender that was already blocked answers 200 with the entry that was there: what was asked for is true either way.

{
    "data": {
    "id": "blk_5ws77sgyjhhkqb66",
    "object": "mail_blocked_sender",
    "kind": "domain",
    "pattern": "amexp.com",
    "author": "Mick Schmidt",
    "created_at": "2026-09-25T10:14:02.000000Z",
    "hits": 3,
    "last_hit_at": "2026-09-25T16:40:51.000000Z"
},
    "meta": { "request_id": "req_01kz4bkr1aj1gv63d8fv3133ey" }
}

Errors

StatusCodeMeaning
400missing_idempotency_keyEvery POST needs one
400invalid_senderNot an address or a domain that can be blocked
400own_senderOne of this environment's own addresses or domains. Forgeries of those are refused already
403insufficient_scopeThis device does not hold mail:write
403forbiddenThe account does not hold manage_mailbox
422validation_failedpattern missing