APIs & Integrations

Not applicable

Pull companies by ID

Hi, guys.
I’m wondering is there a chance I can pull companies by ids I’m interested in? There is a super useful API for contacts:
Search for a batch of contacts by ID
I want the same for companies.
Maybe there are some hidden possibility, not described in docs or any plans to implement that in the future?
Issue there is that I’m pulling only deals when user is owner and related contacts and companies. I’m getting associatedVids and associatedCompanyIds from deals response. Then I can pull contacts I need. But with companies i have to iterate over all companies in portal (sometimes there are too much) and filter only those I need.
This results in redundant requests to hubspot API and it is also time consuming.

0 Upvotes
1 Reply 1
Dadams
HubSpot Employee
HubSpot Employee

Pull companies by ID

Hi @denko

Companies can be retrieved individually by the ID:

Get a Company | Companies API

GET /companies/v2/companies/:companyId - Returns an object representing the company with the id :companyId associated with the specified portal

We don’t currently have a way to get multiple contacts by ID, but batch APIs for companies are something that we’re working on.

If you’re pulling all of your contacts, you may want to also get all of your companies, and store the companyId so that you can reference the company without needing to pull the company separately each time you’re updating contacts.

Get Recent Companies | Companies API

GET /companies/v2/companies/recent/modified - Returns all of the recently updated companies.