Skip to the documentation
API

Block a contact

Puts the address on the workspace blocklist, the one `PATCH /settings` edits as `blockedSenders`, so mail from it is refused from then on. This is Block on a contact in the app. The address does not have to be a contact.

POSTapi.openemail.uk/contacts/{email}/block

Runs the real call against your workspace, with your own key.

POST /contacts/{email}/block

Puts the address on the workspace blocklist, the one PATCH /settings edits as blockedSenders, so mail from it is refused from then on. This is Block on a contact in the app. The address does not have to be a contact.

Example

Needs settings:write, because it writes the blocklist rather than the contact. URL-encode the @.

curl
curl -X POST "$OE/contacts/offers%2Bweekly%40shop.example/block" -H "$AUTH"
Response
{  "object": "contact_block",  "email": "[email protected]",  "blocked": true,  "blockedBy": { "rule": "[email protected]", "list": "blockedSenders" },  "created": true}

A plus tag is dropped, so blocking [email protected] blocks [email protected] and every tag of it.

When a rule already blocks the address, a whole-domain rule included, nothing is added: created is false and blockedBy names that rule. Sending the same call again is therefore safe.

An address with fewer than two letters or numbers is a 422 blocklist_entry_too_broad.