Manage Subscribers On Lists
You can add and remove subscribers from lists as part of importing subscribers. You can also manage subscribers and lists as part of creating Subscription Centers. The SubscriberList object, when acted upon as the child of a Subscriber object, enables the before mentioned use cases.
The information and sample code below presents the necessary information to manage subscribers on lists. Use the examples as models to construct your own API calls.
The SubscriberList object represents the union between subscribers and lists.
- Create: creates an existing subscriber on a list
- Update: updates an existing subscriber on a list (for status purposes primarily)
- Delete: deletes an existing subscriber from a list
- Upsert: Creates the subscriber on the list if they don't exist or updates them if they already exist on the list.
When using the SubscriberList object on Create and Update methods, the ID property represents the ID of the list. On the Retrieve method, the ID property represents the ID of the Subscriber (with the List.ID representing the List ID). Retrieve also supports Subscriber.SubscriberKey as an identifer.
This example assumes the subscriber exists in the account but not on the list.
This example assumes the subscriber exists on the list already.
The code below unsubscribes the subscriber from all lists the subscriber is on. Specify a ListID in the code to remove the subscriber from a specific list.