Parent Child relationships for Companies in the API

companies

#1

Is it possible to access the set of related companies via the API? I’m specifically looking to access the information described here: https://www.hubspot.com/product-updates/introducing-parent-child-relationships-in-hubspot-crm

I’ve tried looking at the documentation and it is not obvious.


#2

@jsmallwood We are currently working on release of an API that will cover all of this. As this is a new feature that came out this quarter we are still working on some of the surrounding support to the new relationship.


#3

@pmanca Is there any estimated release date at this point?


#4

@Max_Bailey I don’t have a time-table yet on when these endpoints will be made public and supported through our Open APIs


#5

hi @pmanca, any update on this feature?


#6

Hey Max-

This feature has now been GA for over 8 months. As a major data integration point for any size business, it sure would be nice to have some api exposure to to this data relationship.

We’ve been waiting patiently since March, and this is now becoming a critical path go-live issue.

Regards,
Chad


#7

@sonnyjordan I don’t have an update at the moment for this.


#8

Hi, I was able to add a relationship between companies with a PUT to this URL:

https://api.hubspot.com/companies/v2/families/{parent_id}/associations?childCompanyId={child_id}&portalId={portal_id}

Maybe you could use a GET request to a similar URL to get the associations info.

Raúl


#9

Amazing - works! thanks for sharing the endpoint @raulmj83


#10

Hi jsmallwood!!

You can get the ids of the children like this:

GET https://api.hubapi.com/companies/v2/families/{parent_company_id}/children/with-total?hapikey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

For example:

GET https://api.hubapi.com/companies/v2/families/263964841/children/with-total?hapikey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

{
“results”: [
** 512031457,**
** 512033679,**
** 512097152**
** ],**
“hasMore”: false,
“offset”: 512097152,
“total”: 3,
“exceededTotalLimit”: false
}

And you can get the id of the parent company including the property ‘hs_parent_company_id’ at the request of the companies:

For example:

GET https://api.hubapi.com/companies/v2/companies/paged?properties=hs_parent_company_id&limit=10&hapikey=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

.................
.................
.................
},
{
  "portalId": xxxxxxx,
  "companyId": 246966882,
  "isDeleted": false,
  "properties": {
    **"hs_parent_company_id": {**

** “value”: “454819377”**,
“timestamp”: 1495099113145,
“source”: “COMPANY_FAMILIES”,
“sourceId”: “CompanyFamilyManager”,
“versions”: [
{
“name”: “hs_parent_company_id”,
“value”: “454819377”,
“timestamp”: 1495099113145,
“sourceId”: “CompanyFamilyManager”,
“source”: “COMPANY_FAMILIES”,
“sourceVid”: [

          ]
        }
      ]
    }
  },
  "additionalDomains": [
    
  ],
  "stateChanges": [
    
  ],
  "mergeAudits": [
    
  ]
},
{
.................
.................
.................

regards


#11

Any idea when the documentation will be updated? I’m concerned someone has found functionality in the API that may not be fully baked.


#12

Hi @jsmallwood,

Can you click the ‘Submit feedback’ button on the relevant developer document? I’d be more than happy to take a look at revising/updating the documentation.


#13

I provided feed back on the Company Overview page.


#14

Hi all,

I wanted to provide some more context on this topic: Any endpoints that aren’t listed on https://developers.hubspot.com/ are considered internal endpoints and are subject to be changed or removed at any point without notice. The specific endpoints mentioned here were not intended to be used outside of the HubSpot app, and it’s not something we currently have a public endpoint for.


#15

Did you need to include anything in the Body/Headers of the PUT request? It seems like all needed info (Portal ID & IDs of the two companies) is already included in the url, but I’m having trouble getting this to work.

I was able to get a response to puntouan’s GET request (below) simply by entering it in the address bar of my browser


#16

All the info is in the URL, but you have to use your API key or OAuth token to make the PUT request.

And as @Derek_Gervais wrote, have in mind that your code can’t rely on this kind of undocumented calls, it’s just meant for getting or inserting data programmatically at a certain moment (e.g. migrating data from another CRM system).

Hope they add it to the official API someday!


#17

Would like to add my vote to having this available in the API. I still don’t see this in the API docs. @Derek_Gervais can you provide an update before I go with the undocumented endpoint?

Thanks,

Jason


#18

This is something my business needs as well, would be highly appreciated if this can be added as documented endpoints as soon as possible.


#20

Over a year since this feature released and still no documented API endpoints???


#21

@Derek_Gervais Is there an update on documentation for this?