# Object data fetch - sorting out associations

**URL:** <https://community.hubspot.com/t/object-data-fetch-sorting-out-associations/60147>\
**Category:** APIs & Integrations\
**Tags:** sdk\
**Created:** [June 30, 2022, 5:52pm UTC](https://community.hubspot.com/t/object-data-fetch-sorting-out-associations/60147 "2022-06-30T17:52:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IntegrationDev](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/integrationdev/32/1529_2.png) [@IntegrationDev](https://community.hubspot.com/u/IntegrationDev)\
**Post date:** [June 30, 2022, 5:52pm UTC](https://community.hubspot.com/t/object-data-fetch-sorting-out-associations/60147/1 "2022-06-30T17:52:21Z")

</div>

Hello,

When a V3 GET object data request asks for association details (e.g GET {baseUrl}/crm/v3/objects/deals?

associations=…

), the response sent back contains an association object per relevant association. These objects contain a **label** property. Can you help me make sense out of these labels? 🙂

Example Request:

[https://api.hubapi.com/crm/v3/objects/deals?associations=companies](https://api.hubapi.com/crm/v3/objects/deals?associations=companies)

Example Response Fragment:

```lia-code-sample
{
 "results": [
 {
 "id": "9185082778",
 "properties": {...},
 ...,
 "associations": {
 "companies": {
 "results": [
 {
 "id": "8913841277",
 "type": "deal_to_company"
 },
 {
 "id": "8913841277",
 "type": "deal_to_company_unlabeled"
 },
 {
 "id": "8939397913",
 "type": "deal_to_company_unlabeled"
 },
 {
 "id": "9028443392",
 "type": "deal_to_company_unlabeled"
 },
 {
 "id": "9028444473",
 "type": "deal_to_company_unlabeled"
 },
 {
 "id": "9028443392",
 "type": "facilitator"
 }
 ]
 }
 }
 }
 ]
}

```

My guess on how labels work:

- It looks like **every** association gets an “\_unlabeled” entry. Example: The above deal is associated with a total of 4 companies, so 4 “deal\_to\_company\_unlabeled” association objects are present.
- Additionally, it looks like the primary association gets an entry with an “object\_to\_object” style label (in this case, “deal\_to\_company”). Since there can only be one primary association, I’m guessing that this label can only appear once in an object’s associations collection.
- Lastly, it looks like any associations with custom labels show up with a corresponding label. Example above: the “facilitator” association.

If these rules are applied to the above example, 8913841277 is the primary deal\_to\_company relationship, 9028443392 has a facilitator relationship and 8939397913 + 9028444473 have a non-primary/non-labeled relationship.

Is this the logic that’s used?

Thank you!

---

<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:** [July 1, 2022, 3:42pm UTC](https://community.hubspot.com/t/object-data-fetch-sorting-out-associations/60147/2 "2022-07-01T15:42:59Z")

</div>

Hi, @IntegrationDev, you got it ✅ This knowledge base article give a lot more detail into Association Labels in HubSpot — [Create and use association labels](https://knowledge.hubspot.com/crm-setup/create-and-use-association-labels)

Happy building! — Jaycee

---

<div class="post-metadata">

**Author:** ![IntegrationDev](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/integrationdev/32/1529_2.png) [@IntegrationDev](https://community.hubspot.com/u/IntegrationDev)\
**Post date:** [July 1, 2022, 7:52pm UTC](https://community.hubspot.com/t/object-data-fetch-sorting-out-associations/60147/3 "2022-07-01T19:52:45Z")

</div>

Thank you, [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074)!
