# Error when adding to sequence via API

**URL:** <https://community.hubspot.com/t/error-when-adding-to-sequence-via-api/119457>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [October 29, 2024, 9:00pm UTC](https://community.hubspot.com/t/error-when-adding-to-sequence-via-api/119457 "2024-10-29T21:00:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevUserGems](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@DevUserGems](https://community.hubspot.com/u/DevUserGems)\
**Post date:** [October 29, 2024, 9:00pm UTC](https://community.hubspot.com/t/error-when-adding-to-sequence-via-api/119457/1 "2024-10-29T21:00:01Z")

</div>

Hello!

I am trying to use the new Sequences API to enroll a contact to a sequence, using [this endpoint](https://developers.hubspot.com/beta-docs/reference/api/automation/sequences#post-%2Fautomation%2Fv4%2Fsequences%2Fenrollments).

However I get the following error:

`User .. for Portal .. has no connected inboxes, which are required in order to enroll from the public API`

I am aware that we need to connect an inbox, and have done so with that user. In fact, I can successfully enroll the same contact I tried with the API to the sequence via the UI.

I have triple checked userId, contactId, sequenceId and used the users’ e-mail as the senderEmail.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [October 30, 2024, 4:00pm UTC](https://community.hubspot.com/t/error-when-adding-to-sequence-via-api/119457/2 "2024-10-30T16:00:27Z")

</div>

Hey, @DevUserGems 👋 Did you get this worked out? Or are you still running into the same issue? — Jaycee

---

<div class="post-metadata">

**Author:** ![DevUserGems](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@DevUserGems](https://community.hubspot.com/u/DevUserGems)\
**Post date:** [October 30, 2024, 6:44pm UTC](https://community.hubspot.com/t/error-when-adding-to-sequence-via-api/119457/3 "2024-10-30T18:44:43Z")

</div>

Hello!

Thank you for looking into it. Yes, it did work now for the same payload I had on the script.

Edit: I realized the error was sending incorret “sendEmail”. It must match the linked inbox. I was sending the user’s e-mail, not the one connected as inbox.

Can I ask something else though? I was able to successfully enroll a contact using our production account. Then, I went to the developer account and did the same thing, but I get the same generic error with all contacts I try (HTTP 400).

`{"status":"error","message":"Something went wrong.","errorType":"SequenceError.INTERNAL_ERROR","correlationId":"0a46e2ac-355c-4789-97a9-307adfcd20b0"}`

Then, I went to the UI and tryed enrolling from there and saw that all contacts from the test account we use are showing this message:

 ![DevUserGems_2-1730314016764.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/9/5977b5c28fb4a120a841729d9197a33a8875714c.png)

I should add that I even created random domain e-mails and still got this message.

Are we not able to use the test accounts for developing sequence integration right now or is it something I can set up?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [October 30, 2024, 8:35pm UTC](https://community.hubspot.com/t/error-when-adding-to-sequence-via-api/119457/4 "2024-10-30T20:35:18Z")

</div>

Hey, @DevUserGems 👋 That’s a great question 💡

I believe I found our answer. It’s not documented under the Developer Test Account documentation, but it is in the [**Sandbox knowledge base**](https://knowledge.hubspot.com/account-management/set-up-a-hubspot-standard-sandbox-account#:~:text=You%20can%20send,your%20sandbox%20account.). Essentially, with these test accounts, you can only make sends to other _existing_ users in the test account. So you’ll need to create a Contact record using the same email you have set up for your user. Once you do that, the Contact record for your User should be an option in the Sequence enrollment.

Screenshot after I created a Contact for my User

 ![CleanShot 2024-10-30 at 14.33.37@2x.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/a/a074f6548762edb7d402560d01eb48336df953e0.png)

Talk soon! — Jaycee

---

<div class="post-metadata">

**Author:** ![DevUserGems](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@DevUserGems](https://community.hubspot.com/u/DevUserGems)\
**Post date:** [October 31, 2024, 5:59pm UTC](https://community.hubspot.com/t/error-when-adding-to-sequence-via-api/119457/5 "2024-10-31T17:59:28Z")

</div>

Thanks a lot for the help! That was indeed the case.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [November 1, 2024, 8:50pm UTC](https://community.hubspot.com/t/error-when-adding-to-sequence-via-api/119457/6 "2024-11-01T20:50:57Z")

</div>

Boom 💥 Glad to hear that. Have a fantastic weekend! — Jaycee
