# out out all from api

**URL:** <https://community.hubspot.com/t/out-out-all-from-api/10767>\
**Category:** Email Marketing Tool\
**Created:** [October 30, 2018, 5:43pm UTC](https://community.hubspot.com/t/out-out-all-from-api/10767 "2018-10-30T17:43:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![carrng](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/carrng/32/59606_2.png) [@carrng](https://community.hubspot.com/u/carrng)\
**Post date:** [October 30, 2018, 5:43pm UTC](https://community.hubspot.com/t/out-out-all-from-api/10767/1 "2018-10-30T17:43:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jenny](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jenny/32/24_2.png) [@Jenny](https://community.hubspot.com/u/Jenny)\
**Post date:** [October 31, 2018, 7:25pm UTC](https://community.hubspot.com/t/out-out-all-from-api/10767/2 "2018-10-31T19:25:12Z")

</div>

Hi @carrng,

Does [this conversation](https://integrate.hubspot.com/t/how-to-opt-a-contact-out-of-email-via-api-by-using-c/865) from the developers forum speak to what you are looking to accomplish?

cc [@Derek\_Gervais](https://community.hubspot.com/t5/user/viewprofilepage/user-id/142)

Thanks,  
Jenny

---

<div class="post-metadata">

**Author:** ![carrng](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/carrng/32/59606_2.png) [@carrng](https://community.hubspot.com/u/carrng)\
**Post date:** [October 31, 2018, 7:29pm UTC](https://community.hubspot.com/t/out-out-all-from-api/10767/3 "2018-10-31T19:29:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jenny](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jenny/32/24_2.png) [@Jenny](https://community.hubspot.com/u/Jenny)\
**Post date:** [November 1, 2018, 12:51pm UTC](https://community.hubspot.com/t/out-out-all-from-api/10767/4 "2018-11-01T12:51:06Z")

</div>

Thanks for the update @carrng!

@tjoyce do you have any suggestions for @carrng?

---

<div class="post-metadata">

**Author:** ![tjoyce](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tjoyce/32/88832_2.png) [@tjoyce](https://community.hubspot.com/u/tjoyce)\
**Post date:** [November 1, 2018, 2:48pm UTC](https://community.hubspot.com/t/out-out-all-from-api/10767/5 "2018-11-01T14:48:36Z")

</div>

@carrng - I think you would have to use the [subscription definitions endpoint](https://developers.hubspot.com/docs/methods/email/get_subscriptions) and loop through those and store them in an array.

Then you can pass the array to [this endpoint](https://developers.hubspot.com/docs/methods/email/update_status)to unsubscribe.

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

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [November 1, 2018, 3:23pm UTC](https://community.hubspot.com/t/out-out-all-from-api/10767/6 "2018-11-01T15:23:21Z")

</div>

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:

```auto
{
 "unsubscribeFromAll": true
}

```

[https://developers.hubspot.com/docs/methods/email/update\_status](https://developers.hubspot.com/docs/methods/email/update_status)
