out out all from api

SOLVE
carrng
Member

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.

0 Upvotes
1 Accepted solution

Accepted Solutions
Derek_Gervais
Solution
HubSpot Alumni

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
jennysowyrda
Community Manager

Hi @carrng,

 

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

 

cc @Derek_Gervais

 

Thanks,
Jenny

0 Upvotes
carrng
Member

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

0 Upvotes
jennysowyrda
Community Manager

Thanks for the update @carrng!

 

@tjoyce do you have any suggestions for @carrng?

0 Upvotes
tjoyce
Recognized Expert | 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. 

Derek_Gervais
Solution
HubSpot Alumni

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