# Email subscriptions

**URL:** <https://community.hubspot.com/t/email-subscriptions/52092>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [February 24, 2022, 2:54pm UTC](https://community.hubspot.com/t/email-subscriptions/52092 "2022-02-24T14:54:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jojoswe](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jojoswe](https://community.hubspot.com/u/jojoswe)\
**Post date:** [February 24, 2022, 2:54pm UTC](https://community.hubspot.com/t/email-subscriptions/52092/1 "2022-02-24T14:54:08Z")

</div>

I am trying to migrate/sync a bunch of contacts from another system to Hubspot. The contact is copied fine, but I can’t for my life get how to set the “Opt\_in” state on the subscription. I can see in the Email registation history that the call comes in, but it says “Not opted” despite me sending optState = OPT\_IN.

Is there a restriction somewhere? I have not enabled DOI.

Endpoint: /email/public/v1/subscriptions/x.y@z.com

JSON:

{“subscribed”:false,“markedAsSpam”:false,“bounced”:false,“subscriptionStatuses”:[{“id”:1234567,“subscribed”:true,“optInState”:“OPT\_IN”}],“isNameValue”:false,“routeBasePath”:“/email/public/v1”}

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 25, 2022, 4:15pm UTC](https://community.hubspot.com/t/email-subscriptions/52092/2 "2022-02-25T16:15:24Z")

</div>

Hey @jojoswe

I think **optInState** should be **optState**

---

<div class="post-metadata">

**Author:** ![jojoswe](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jojoswe](https://community.hubspot.com/u/jojoswe)\
**Post date:** [February 28, 2022, 7:29am UTC](https://community.hubspot.com/t/email-subscriptions/52092/3 "2022-02-28T07:29:49Z")

</div>

Thanks Dennis, that was it!
