# Sending emails via API doesn't work correctly

**URL:** <https://integration.keap.com/t/sending-emails-via-api-doesnt-work-correctly/84729>\
**Category:** API Q&A\
**Tags:** api, email\
**Created:** [August 24, 2021, 11:01am UTC](https://integration.keap.com/t/sending-emails-via-api-doesnt-work-correctly/84729 "2021-08-24T11:01:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shekhar\_Borulkar](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@Shekhar\_Borulkar](https://integration.keap.com/u/Shekhar_Borulkar)\
**Post date:** [August 24, 2021, 11:01am UTC](https://integration.keap.com/t/sending-emails-via-api-doesnt-work-correctly/84729/1 "2021-08-24T11:01:53Z")

</div>

Hello, I am trying to send email according to the docs: [https://keys.developer.keap.com/docs/keap-150k/1/routes/emails/queue/post](https://keys.developer.keap.com/docs/keap-150k/1/routes/emails/queue/post)  
Using this body:

```auto
{
"contacts_id":"20",
"user_id": "1",
"subject":"Something is wrong",
"plain_content":"SGFzZmRnZGhqa2xraGtnZmRzZXJlIDIzIGF0IGRkZ2FzZGFkYXNkVGF0YW5nbywgd2UgaGF2ZSBjb21lIG91dCB3aXRoIHlldCBhbm90aGVyIHVuaXF1ZSBzZXJ2aWNlIHRoYXQgd2lsbCBncmVhdGx5IGVuaGFuY2UgdGhlIHRleHQgbWVzc2FnZSBtYXJrZXRpbmcgZXhwZXJpZW5jZSBmb3IgYm90aCBicmFuZHMgYW5kIHRoZWlyIGN1c3RvbWVycw==",
}

```

I am getting response 202 which signals that everything is fine. I can also see the email in the UI but only on dashboard in recent activity or in the contact’s chronological view the email was sent to. But it’s not clickable, I see the subject and that it was sent but I cannot open it. In group view there’s nothing. When I send an email from the UI it works just fine. The email from the API won’t also show up in history (Reports → Sent Emails Tracker). The one from the UI shows there. Could someone help me with it?

---

<div class="post-metadata">

**Author:** ![JustinGourley](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/justingourley/32/12672_2.png) [@JustinGourley](https://integration.keap.com/u/JustinGourley)\
**Post date:** [August 26, 2021, 4:00pm UTC](https://integration.keap.com/t/sending-emails-via-api-doesnt-work-correctly/84729/2 "2021-08-26T16:00:04Z")

</div>

If you dont mind submitting a ticket on this I am happy to investigate why the endpoint may not be providing an accurate response.

However, it looks like the the payload should have “contacts” rather than “contact\_ids”. Also it should be a list(array) of longs rather than a single string.

```auto
{
"contacts": [
   20
],
"user_id": 1,
"subject":"...",
"plain_content":"...",
}

```

---

<div class="post-metadata">

**Author:** ![Daniel\_Hernandez](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@Daniel\_Hernandez](https://integration.keap.com/u/Daniel_Hernandez)\
**Post date:** [August 26, 2021, 6:42pm UTC](https://integration.keap.com/t/sending-emails-via-api-doesnt-work-correctly/84729/3 "2021-08-26T18:42:28Z")

</div>

I think you should also add the contacts Ids inside of an array and not as a string, even if you send the email to only one contact.
