The Lists SDK methods lets you create / manage list of subscribers. You can then send broadcast to all the users in the list or create a workflow that triggers when a new user enters / exits list.
In case you want to refresh list with a new set of users completely, you can replace users by creating a draft version of the list and updating users in it.
1
Start Sync to create draft version of the list
This method will create a draft version of the list where you can add the new set of users to replace users.
You can use this method to add subscribers to List draft version created in Step 1. You’ll get version_id in start sync response.
// ================= Add users to a draft list (with versionId)addDistinctIds :=[]string{"id-399999","id-399998"}addResponse, err := suprClient.SubscriberLists.AddToVersion(ctx,"users-with-prepaid-vouchers-1", versionId, addDistinctIds)if err !=nil{ log.Fatalln(err)}log.Println("add to version resp:", addResponse)
3
Remove Subscribers from draft list
You can use this method to remove subscribers from List draft version created in Step 1. You’ll get version_id in start sync response.
// ================= remove users from a listremoveDistinctIds :=[]string{"distinct_id_1","distinct_id_2"}removeResponse, err := suprClient.SubscriberLists.RemoveFromVersion(ctx,"users-with-prepaid-vouchers-1", versionId, removeDistinctIds)if err !=nil{ log.Fatalln(err)}log.Println("remove from version resp: ", removeResponse)
4
Finish Sync to make the draft version live
Once your subscribers are updated in the list, use this method to finish sync and make the draft version updated in above steps live.