out out all from api

SOLVE
Highlighted
New Contributor

It seems like this should be straight forward, but I don't seem to find an endpoint that allows me to opt a contact out completely from the api.

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
Solution
HubSpot Moderator

Hey @carrng,

 

The following endpoint can be used to update an email address' subscription status. As you mentioned before, you can update specific subscriptions by including the subscription ID. However you can also opt the email address out of all email communication. To do that, the body of your request should look like this:

{
    "unsubscribeFromAll": true
}

https://developers.hubspot.com/docs/methods/email/update_status

View solution in original post

5 Replies 5
Highlighted
Community Manager

Hi @carrng,

 

Does this conversation from the developers forum speak to what you are looking to accomplish?

 

cc @Derek_Gervais

 

Thanks,
Jenny


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
Reply
0 Upvotes
Highlighted
New Contributor

That works for opting a contact out of a specific subscription type with the provided ID. It doesn't allow for a complete unsubscribe. 

Reply
0 Upvotes
Highlighted
Community Manager

Thanks for the update @carrng!

 

@tjoyce do you have any suggestions for @carrng?


We are excited to announce that the Community will be launching a weekly newsletter on November 2, 2020!
Sign up today!
Reply
0 Upvotes
Highlighted
Top Advisor | Platinum Partner

@carrng - I think you would have to use the subscription definitions endpoint and loop through those and store them in an array.

Then you can pass the array to this endpoint to unsubscribe.

 

I don't see a flag that can be set to just unsubscribe from all. 

Highlighted
Solution
HubSpot Moderator

Hey @carrng,

 

The following endpoint can be used to update an email address' subscription status. As you mentioned before, you can update specific subscriptions by including the subscription ID. However you can also opt the email address out of all email communication. To do that, the body of your request should look like this:

{
    "unsubscribeFromAll": true
}

https://developers.hubspot.com/docs/methods/email/update_status

View solution in original post