# associate email to a record api is not working?

**URL:** <https://community.hubspot.com/t/associate-email-to-a-record-api-is-not-working/67219>\
**Category:** APIs & Integrations\
**Created:** [October 16, 2022, 4:53pm UTC](https://community.hubspot.com/t/associate-email-to-a-record-api-is-not-working/67219 "2022-10-16T16:53:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SFu5](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@SFu5](https://community.hubspot.com/u/SFu5)\
**Post date:** [October 16, 2022, 4:53pm UTC](https://community.hubspot.com/t/associate-email-to-a-record-api-is-not-working/67219/1 "2022-10-16T16:53:19Z")

</div>

I am trying to associate email to a record with api, but seems not working properly, someone could help here?

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Fapi-reference%2Fcrm-emails-v3%2Fguide)**

I tried with put and post both， not working both， is there anything i did wrong?

 ![test error2.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/c/7c6be31050027c9230330c7188d4c201e42bb8dc.jpeg)

---

<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 17, 2022, 5:18pm UTC](https://community.hubspot.com/t/associate-email-to-a-record-api-is-not-working/67219/2 "2022-10-17T17:18:29Z")

</div>

Hey, @SFu5 👋 Thanks for reaching out! Can you post an example request and response for the association you are doing? Adding it using the code block tool will be helpful, but is not required.

I ran a quick test in Postman:

- I created an email and grabbed the ID

- I used the endpoint provided in the Overview tab — [Associate emails with a record](https://developers.hubspot.com/docs/api/crm/email#associate-emails-with-records)  
`PUT /crm/v3/objects/emails/{emailId}/associations/{toObjectType}/{toObjectId}/{associationType}​`

- Request URL  
`https://api.hubspot.com/crm/v3/objects/emails​`

- My request (I used a Private App for Authorization)  
`PUT https://api.hubspot.com/crm/v3/objects/emails/26823740672/associations/contact/451/198​`

- The response body

 ![CleanShot 2022-10-17 at 11.17.43.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/f/f1f4bf0d8fb6c76b6d43ed86dd503f55ee87d3ea.png)

Thanks for the additional information! — Jaycee

---

<div class="post-metadata">

**Author:** ![SFu5](https://avatars.discourse-cdn.com/v4/letter/s/a698b9/32.png) [@SFu5](https://community.hubspot.com/u/SFu5)\
**Post date:** [October 18, 2022, 2:19am UTC](https://community.hubspot.com/t/associate-email-to-a-record-api-is-not-working/67219/3 "2022-10-18T02:19:27Z")

</div>

Thanks so much, Joycee, I tried you way and it worked now. this is great, thanks.
