# Email opt out via Javascript?

**URL:** <https://community.hubspot.com/t/email-opt-out-via-javascript/11969>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [April 19, 2018, 3:03pm UTC](https://community.hubspot.com/t/email-opt-out-via-javascript/11969 "2018-04-19T15:03:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![greghgs](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/greghgs/32/2490_2.png) [@greghgs](https://community.hubspot.com/u/greghgs)\
**Post date:** [April 19, 2018, 3:03pm UTC](https://community.hubspot.com/t/email-opt-out-via-javascript/11969/1 "2018-04-19T15:03:01Z")

</div>

Is there a way to trigger email opt out via the Javascript API, either via a contact property or custom event?

---

<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:** [April 23, 2018, 3:17pm UTC](https://community.hubspot.com/t/email-opt-out-via-javascript/11969/2 "2018-04-23T15:17:12Z")

</div>

Hi [@greghinchgs](https://community.hubspot.com/u/greghinchgs),

Not directly; the only way to opt out a contact is to make a request to the email subscriptions API, which cannot be done client side.

![]() [developers.hubspot.com](https://developers.hubspot.com/docs/methods/email/update_status)

### [Update email subscription status for an email address | Email API](https://developers.hubspot.com/docs/methods/email/update_status)

PUT /email/public/v1/subscriptions/:email\_address
