# Engagements API not recognizing hs\_email\_headers

**URL:** <https://community.hubspot.com/t/engagements-api-not-recognizing-hs-email-headers/95817>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [December 11, 2023, 7:43pm UTC](https://community.hubspot.com/t/engagements-api-not-recognizing-hs-email-headers/95817 "2023-12-11T19:43:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattPickle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mattpickle/32/84631_2.png) [@MattPickle](https://community.hubspot.com/u/MattPickle)\
**Post date:** [December 11, 2023, 7:43pm UTC](https://community.hubspot.com/t/engagements-api-not-recognizing-hs-email-headers/95817/1 "2023-12-11T19:43:43Z")

</div>

I’m trying to log emails to the CRM via the API, with the appropriate from/to names and email addresses. The docs show different ways to structure the payload on different pages, but I haven’t been able to get anything to work.  
Here is the payload I’m sending, with the hs\_email\_headers value copied directly from the [docs](https://developers.hubspot.com/docs/api/crm/email):

```lia-code-sample
{
 "properties": {
 "hs_timestamp": "2019-10-30T03:30:17.883Z",
 "hs_email_text": "Test test test",
 "hs_email_subject": "Test Subject",
 "hs_email_direction": "EMAIL"
 },
 "hs_email_headers": "{\"from\":{\"email\":\"from@domain.com\",\"firstName\":\"FromFirst\",\"lastName\":\"FromLast\"},\"sender\":{\"email\":\"sender@domain.com\",\"firstName\":\"SenderFirst\",\"lastName\":\"SenderLast\"},\"to\":[{\"email\":\"ToFirst+ToLast<to@test.com>\",\"firstName\":\"ToFirst\",\"lastName\":\"ToLast\"}],\"cc\":[],\"bcc\":[]}",
 "associations": [{
 "to": {
 "id": 40958
 },
 "types": [{
 "associationCategory": "HUBSPOT_DEFINED",
 "associationTypeId": 198
 }]
 }]
 }

```

I have also tried including the hs\_email\_headers value as json instead of a string. Both methods result in an email being successfully logged and associated to the Contact record, but the hs\_email\_header values I passed are ignored. The email is logged with the Contact’s name for “To” instead of the one I passed, and nothing for “From.”

 ![Screenshot 2023-12-11 at 1.22.38 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/e/be282496a5c1b6988518e77c8882c73aba0c29c2.png)

Has anyone been able to get this to work?

---

<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:** [December 12, 2023, 5:45pm UTC](https://community.hubspot.com/t/engagements-api-not-recognizing-hs-email-headers/95817/2 "2023-12-12T17:45:15Z")

</div>

Hey, @MattPickle 👋 This is one I have not tested out myself. If you are still having issues, I am happy to spin up a quick test and try to reproduce the issue.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![MattPickle](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mattpickle/32/84631_2.png) [@MattPickle](https://community.hubspot.com/u/MattPickle)\
**Post date:** [December 12, 2023, 5:55pm UTC](https://community.hubspot.com/t/engagements-api-not-recognizing-hs-email-headers/95817/3 "2023-12-12T17:55:47Z")

</div>

Yes, I am still having the issue. Any help would be appreciated.
