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.
Hi @carrng,
Does this conversation from the developers forum speak to what you are looking to accomplish?
Thanks,
Jenny
That works for opting a contact out of a specific subscription type with the provided ID. It doesn’t allow for a complete unsubscribe.
@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.
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