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)
https://api.selzy.com/en/api/unsubscribe?format=json&api_key=KEY&[email protected]&contact_type=
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:

[email protected]
list_ids List codes separated by comma from which contact is being unsubscribed. If the codes are not specified, we unsubscribe the contact from all lists in which it is located at the time of the request. The contact will be unsubscribed from the lists, but the status of the contact does not change for the account. To change the status in the account use the importContacts method with email_status='unsubscribed' parameter value.

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 "[email protected]" not found",

Did we answer to your question?