# Contact association with a custom Object

**URL:** <https://community.hubspot.com/t/contact-association-with-a-custom-object/74947>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [February 10, 2023, 11:00am UTC](https://community.hubspot.com/t/contact-association-with-a-custom-object/74947 "2023-02-10T11:00:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SErrigo](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@SErrigo](https://community.hubspot.com/u/SErrigo)\
**Post date:** [February 10, 2023, 11:00am UTC](https://community.hubspot.com/t/contact-association-with-a-custom-object/74947/1 "2023-02-10T11:00:59Z")

</div>

Hi,

I’m building for my customer automation that creates a record in a custom object. This custom object has a foreign key value with a contact username. When my customer click on the username, he would like to find the association with the Contacts automatically. Can you please help me on defining which Endpoint should I use to create this association?

With some examples

Thank you in advance

 ![SErrigo_0-1676026584519.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/d/8/d88bb5001600405c178a77d3849cb5618a22e772.png)

 ![SErrigo_1-1676026778299.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/b/2/b22f1b721d9db4eb4dd135259d389a1280a093aa.png)

---

<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:** [February 10, 2023, 10:22pm UTC](https://community.hubspot.com/t/contact-association-with-a-custom-object/74947/2 "2023-02-10T22:22:55Z")

</div>

Hey, @SErrigo 👋 Here’s what you’ll need to get started building.

- Query this endpoint, [**Retrieve association types**](https://developers.hubspot.com/docs/api/crm/associations#:~:text=Retrieve%20association%20types), to get the association type IDs from _your Custom Object_ to the Contacts object. Here’s my example using my custom object Boat:  
`GET /crm/v4/associations/boat/contacts/labels​`

- Then we can use the Associate an object with another object endpoint to create the association. Documentation — [Associate records and set an association label](https://developers.hubspot.com/docs/api/crm/associations#:~:text=Associate%20records%20and%20set%20an%20association%20label).  
My example:

This set the association from Boat \> Contact for my contact Bob Belcher (contact ID 901) and used the custom association label I created previously called tacos (I must have needed lunch that day… 🤣)  
Have fun building! — Jaycee

---

<div class="post-metadata">

**Author:** ![SErrigo](https://avatars.discourse-cdn.com/v4/letter/s/f1d935/32.png) [@SErrigo](https://community.hubspot.com/u/SErrigo)\
**Post date:** [February 13, 2023, 8:34am UTC](https://community.hubspot.com/t/contact-association-with-a-custom-object/74947/3 "2023-02-13T08:34:52Z")

</div>

Thank you so much [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) this is exactly what I was looking for.

I hope you eat something after this​😜

---

<div class="post-metadata">

**Author:** ![DStaat](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dstaat/32/3537_2.png) [@DStaat](https://community.hubspot.com/u/DStaat)\
**Post date:** [September 28, 2023, 8:13pm UTC](https://community.hubspot.com/t/contact-association-with-a-custom-object/74947/4 "2023-09-28T20:13:17Z")

</div>

Hey @SErrigo,  
I’m a little late to the party but have you heard of [Associ8](https://ecosystem.hubspot.com/marketplace/apps/productivity/workflow-automation/associations-app-272901)? It lets you automatically create associations between objects based on parameters you set. There’s some documentation showing how it works [here](https://hapily.com/blog/associ8-technical-deep-dive).  
Let me know if you have any questions! I’d be happy to talk with you about it in more detail.  
Best,  
-David Staat
