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.
Runs the real call on your workspace.
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 -X POST "$OE/contacts/offers%2Bweekly%40shop.example/block" -H "$AUTH"{ "object": "contact_block", "email": "offers@shop.example", "blocked": true, "blockedBy": { "rule": "offers@shop.example", "list": "blockedSenders" }, "created": true}A plus tag is dropped, so blocking offers+weekly@shop.example blocks offers@shop.example 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.
Google Workspace