APIs & Integrations

SKumar00
Participant

I am not able to fetch the primary company from the deal api

SOLVE

I am using Hubspot API and fetching data through Airbyte, for deals api, I can see that there are multiple companies id, how do I identify the which is primary company associated to that deal?

{
 "archived": false,
 "companies": [
   "19642076053",
   "19473581391",
   "19642076053"
 ],
 "contacts": [
   "20437202"
 ],
 "createdAt": "2024-02-08T03:51:49.123Z",
 "id": "18040077916",
 "line_items": [
   "28045840280"
 ],
 "properties": {
   "account_legal_name": null,
   "account_manager": null,
   "ace_opportunity_id_url": null,
   "activation": null,
   "activation_type": "One Time",
.......
}
 "updatedAt": "2025-04-17T09:14:31.024Z"
}

 

This is how receive data through Airbyte, but I can't identify which is primary company?

there is no associated fields also in this.

 

0 Upvotes
1 Accepted solution
Jaycee_Lewis
Solution
Community Manager
Community Manager

I am not able to fetch the primary company from the deal api

SOLVE

Hey @SKumar00 👋 Welcome to our community! Thank you very much for your post. It may be worth checking with Airbyte on this question as well. I found their support forum here

 

Stepping outside the connector, we would get those labels, such as Primary, from making a request to the Associations API endpoints and the response will include the labels you are after. I am not sure how Airbyte handles this, as it is not listed in the documentation specifically. 

 

I'll add a quick example of what the response from the Associations API looks like so you know what to expect from it. 

 

I know this is not the answer you are after, and I want to share our available and documented options for meeting your goal.

 

Have fun testing! — Jaycee


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !

View solution in original post

0 Upvotes
3 Replies 3
SKumar00
Participant

I am not able to fetch the primary company from the deal api

SOLVE

Thank you so much, I am able to get it.

0 Upvotes
Jaycee_Lewis
Solution
Community Manager
Community Manager

I am not able to fetch the primary company from the deal api

SOLVE

Hey @SKumar00 👋 Welcome to our community! Thank you very much for your post. It may be worth checking with Airbyte on this question as well. I found their support forum here

 

Stepping outside the connector, we would get those labels, such as Primary, from making a request to the Associations API endpoints and the response will include the labels you are after. I am not sure how Airbyte handles this, as it is not listed in the documentation specifically. 

 

I'll add a quick example of what the response from the Associations API looks like so you know what to expect from it. 

 

I know this is not the answer you are after, and I want to share our available and documented options for meeting your goal.

 

Have fun testing! — Jaycee


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

I am not able to fetch the primary company from the deal api

SOLVE

My example:

  • I created a Deal
  • Associated 4 companies with it, with one being the Primary
  • Used the Deal ID to make a request to the Associations API 
  • View the label “Primary”

 

Request

GET {{API URL}}/crm/v4/objects/0-3/36526838310/associations/0-2 

Response

{
    "results": [
        {
            "toObjectId": 10202231613,
            "associationTypes": [
                {
                    "category": "HUBSPOT_DEFINED",
                    "typeId": 5,
                    "label": "Primary"
                },
                {
                    "category": "HUBSPOT_DEFINED",
                    "typeId": 341,
                    "label": null
                }
            ]
        },
        {
            "toObjectId": 11685858563,
            "associationTypes": [
                {
                    "category": "HUBSPOT_DEFINED",
                    "typeId": 341,
                    "label": null
                }
            ]
        },
        {
            "toObjectId": 13861282304,
            "associationTypes": [
                {
                    "category": "HUBSPOT_DEFINED",
                    "typeId": 341,
                    "label": null
                }
            ]
        },
        {
            "toObjectId": 16053398365,
            "associationTypes": [
                {
                    "category": "HUBSPOT_DEFINED",
                    "typeId": 341,
                    "label": null
                }
            ]
        }
    ]
}

 

Best,

Jaycee


HubSpot’s AI-powered customer agent resolves up to 50% of customer queries instantly, with some customers reaching up to 90% resolution rates.
Learn More.


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !