Unsubscribe from a sender
What the Unsubscribe button of the Subscriptions page does.
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. archive: true also archives every conversation from the sender, and bin: true moves them to the Bin instead. The body is optional.
curl -X POST "$OE/subscriptions/sub_5d2c8e17/unsubscribe" -H "$AUTH" \ -H "Content-Type: application/json" -d '{ "archive": true }'{ "object": "unsubscribe", "subscriptionId": "sub_5d2c8e17", "method": "one-click", "url": null, "binned": 0, "archived": 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.
Google Workspace