Parent Child relationships for Companies in the API

jsmallwood
Member

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.

0 Upvotes
22 Replies 22
3PETE
HubSpot Employee

@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.

0 Upvotes
maxbailey
Member

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

0 Upvotes
3PETE
HubSpot Employee

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

0 Upvotes
Wholesale-Solar
Top Contributor

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

0 Upvotes
3PETE
HubSpot Employee

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

0 Upvotes
sonnyjordan
Participant

hi @pmanca, any update on this feature?

Not applicable

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}&por...

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

Raúl

maxbailey
Member

Amazing - works! thanks for sharing the endpoint @raulmj83

0 Upvotes
chris_p_lukes
Participant | Elite Partner

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

0 Upvotes
Not applicable

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!

0 Upvotes
Not applicable

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-xxx...

{
“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

0 Upvotes
jsmallwood
Member

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

0 Upvotes
Derek_Gervais
HubSpot Employee

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.

0 Upvotes
jsmallwood
Member

I provided feed back on the Company Overview page.

Derek_Gervais
HubSpot Employee

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.

0 Upvotes
jcjones1515
Member

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

0 Upvotes
im-bart
Member

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

0 Upvotes
FloifyEric
Member

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

0 Upvotes
Not applicable

@Derek_Gervais Is there an update on documentation for this?

0 Upvotes
SteveR
Member

+1 we need this functionality also for new enterprise deployment.

0 Upvotes
Derek_Gervais
HubSpot Employee

Hi all,

After a quick search, it appears that there was no existing topic in the HubSpot Ideas Forum. In general, the Ideas Forum is the best place to rally support and get your product feedback seen by HubSpotters. I went ahead and created a topic for this idea; I would encourage everyone to give it kudos and post your use case to support this idea!

0 Upvotes
bsjut
Participant

added my +1 on the idea. I think for us it would be most important to use it to allow in external systems some rollup reporting