API
Unsubscribe from a sender
What the Unsubscribe button of the Subscriptions page does.
POST/subscriptions/{id}/unsubscribe
Runs the real call on your workspace.
POST /subscriptions/{id}/unsubscribe
What the Unsubscribe button of the Subscriptions page does.
Example
Needs threads:write. It unsubscribes the way the sender asks for: a one-click request when it offers one, otherwise an unsubscribe email from the address the mail arrived at. bin: true also moves every conversation from the sender to the Bin. The body is optional.
curl -X POST "$OE/subscriptions/sub_5d2c8e17/unsubscribe" -H "$AUTH" \ -H "Content-Type: application/json" -d '{ "bin": true }'{ "object": "unsubscribe", "subscriptionId": "sub_5d2c8e17", "method": "one-click", "url": null, "binned": 58}A sender that only offers a page answers with method link and the page in url, which a person has to open.
A sender that gives no way to unsubscribe is a 422 unsubscribe_unsupported, and one that did not accept the one-click request and gives no address to write to is a 502 unsubscribe_refused. Nothing changed in either case.