Skip to main content
Contributor I
January 13, 2022
Solved

How to unsubscribe a user from all lists via the API?

  • January 13, 2022
  • 3 replies
  • 1123 views

How to unsubscribe a user from all lists via the API?

 

We’ve got hundreds of mailing lists, so cannot loop around each one unsubscribing hoping they’re in it.

 

How can we get a list of Lists that the user is subscribed to, to unsubscribe them via the API

 

or

 

An API call that unsubscribes the user from all lists they’re members of?

 

Thanks

    This topic has been closed for replies.
    Best answer by sourabh

    Hey @owen_fnatic,

    A user once unsubscribed from a list gets unsubscribed everywhere since that detail gets attached to his profile in Klaviyo and consent is removed globally for that user. 

    The best way to bulk unsubscribe users from mailing lists is to create a separate list of users that you want to unsubscribe and then unsubscribe them all from that list via API. Once that is done, they will be unsubscribed from everywhere and get suppressed. 

     

    curl --request DELETE \
    --url 'https://a.klaviyo.com/api/v2/list/LIST_ID/subscribe?api_key=API_KEY' \
    --header 'Content-Type: application/json' \
    --data '
    {
    "emails": [
    "email1@example.com",
    "email2@example.com"
    ]
    }
    '

     

    3 replies

    sourabh
    Partner
    sourabhAnswer
    Partner
    January 19, 2022

    Hey @owen_fnatic,

    A user once unsubscribed from a list gets unsubscribed everywhere since that detail gets attached to his profile in Klaviyo and consent is removed globally for that user. 

    The best way to bulk unsubscribe users from mailing lists is to create a separate list of users that you want to unsubscribe and then unsubscribe them all from that list via API. Once that is done, they will be unsubscribed from everywhere and get suppressed. 

     

    curl --request DELETE \
    --url 'https://a.klaviyo.com/api/v2/list/LIST_ID/subscribe?api_key=API_KEY' \
    --header 'Content-Type: application/json' \
    --data '
    {
    "emails": [
    "email1@example.com",
    "email2@example.com"
    ]
    }
    '

     

    Sourabh | Let's connect - Twitter: @sourabhramsingh, Linkedin: linkedin.com/in/sourabhramsingh/
    Contributor III
    March 28, 2022

    Hey @owen_fnatic,

    A user once unsubscribed from a list gets unsubscribed everywhere since that detail gets attached to his profile in Klaviyo and consent is removed globally for that user. 

    The best way to bulk unsubscribe users from mailing lists is to create a separate list of users that you want to unsubscribe and then unsubscribe them all from that list via API. Once that is done, they will be unsubscribed from everywhere and get suppressed. 

     

    curl --request DELETE \
    --url 'https://a.klaviyo.com/api/v2/list/LIST_ID/subscribe?api_key=API_KEY' \
    --header 'Content-Type: application/json' \
    --data '
    {
    "emails": [
    "email1@example.com",
    "email2@example.com"
    ]
    }
    '

     

    Wait wat???

    So a user can’t unsubscribe from a single list!?
    So if a user would not want to be part of a list the correct way would be to remove them from the list and not unsubscribe?

    Contributor III
    March 28, 2022

    Okay, so that is the case. You should really add a note about that in the API documentation for the DELETE call.