Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages

unsubscribe method

The method unsubscribes the contact email or phone number from one or several lists. In contrast to the exclude method, it does not exclude a contact from the lists, but marks the contact as «unsubscribed». It is impossible to restore the «active» status through API – it is only the contact who can do this by clicking on the activation link in the letter.

We recommend using the unsubscribe method in case the contact refuses to subscribe, and the exclude method in case subscription/unsubscription is managed on the initiative of the sender.

Principle of use

Syntax and URL to call the method
unsubscribe (string contact_type, string contact, string list_ids)
api_key * API access key.
contact_type * The type of the contact to be unsubscribed is either «email» or «phone».Examples:

contact * Email or phone number that needs be unsubscribed from campaigns.Examples:
list_ids List codes separated by comma from which contacts are being unsubscribed. If it is not specified, contacts will be unsubscribed from all lists. Codes of the lists can be obtained by calling the getLists method. They match the codes used in the subscription form.Examples:

Return value
There will be an empty object in case of success. If any errors or warnings occur, they will be returned in the standard way.
In case of an attempt to unsubscribe an address from the list in which such address is absent, the following error will be returned:

  "error":"Contact "" not found",
Оцените, на сколько вам показалась полезной статья «unsubscribe method»