APIs & Integrations

DBilbija
Member

Creating a new company via API works fine, but initial return company name is empty

SOLVE

Hi all

 

I've been seeing this problem fairly regularly when creating new companies via API. I add the domain name (and HS fills in the rest upon creation)... that works fine, but the company object returned from the POST usually doesn't have any of the HS-filled properties filled in (e.g., Name). I have to re-query to get them. BTW, the new company ID comes back every time as expected.

 

Am I missing something, or is this by design?

 

Dushan

0 Upvotes
1 Accepted solution
MichaelC
Solution
Guide | Partner
Guide | Partner

Creating a new company via API works fine, but initial return company name is empty

SOLVE

@DBilbija @TitiCuisset 

According to the API Documentation here: https://developers.hubspot.com/docs/api/crm/companies

Endpoint create. 

The result should return some basic properties like: name, phone, state et cetera. BUT - you will only get back properties for properties you actually added in your post.

Since you only post the URL (domain name) the company actually does not have a name when you created it - it only has an ID and an URL. 

 

Once the company is created (and you already got your first response) hubspot may add company information based on the URL. But this step does not happend upon creation. It happens a millisecond after you created the company and got your first response. 

 

So - to shortly answer your question: Yes, you are correct. You have to make a second GET request with the ID to get the company data.

 

 

YouHubspotData from third pary (where HS get data through url). It might also be located within hubspots own database. 
1. Creating company > (request)  
 < 2. Company Created (response) 
 3. Request company data > (request) 
  < 4. Company name and data (response)
   
What you want to have:  
1. Creating company --> (request)  
 2. Creating company  
 3. Request company data by URL > (request) 
  < 4. Company name and data (response)
 < 5. Company Created (response) with data.  

 

I would say that its very unlikely to get what you want in this case. You simply have to make a second call and hope that hubspot has completed step 3 and 4 in time. 

 

 



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

View solution in original post

0 Upvotes
3 Replies 3
DBilbija
Member

Creating a new company via API works fine, but initial return company name is empty

SOLVE

Ok, cool. Odd that there isn't a 202 response, which can then let the requestor know it's in process.  I don't send the name (and other fields) since that would imply to HS that I want my name to be whatever I send (even if blank). 

 

Easy enough tho... simple re-query will do the trick.

 

Thx, Michael!

0 Upvotes
MichaelC
Solution
Guide | Partner
Guide | Partner

Creating a new company via API works fine, but initial return company name is empty

SOLVE

@DBilbija @TitiCuisset 

According to the API Documentation here: https://developers.hubspot.com/docs/api/crm/companies

Endpoint create. 

The result should return some basic properties like: name, phone, state et cetera. BUT - you will only get back properties for properties you actually added in your post.

Since you only post the URL (domain name) the company actually does not have a name when you created it - it only has an ID and an URL. 

 

Once the company is created (and you already got your first response) hubspot may add company information based on the URL. But this step does not happend upon creation. It happens a millisecond after you created the company and got your first response. 

 

So - to shortly answer your question: Yes, you are correct. You have to make a second GET request with the ID to get the company data.

 

 

YouHubspotData from third pary (where HS get data through url). It might also be located within hubspots own database. 
1. Creating company > (request)  
 < 2. Company Created (response) 
 3. Request company data > (request) 
  < 4. Company name and data (response)
   
What you want to have:  
1. Creating company --> (request)  
 2. Creating company  
 3. Request company data by URL > (request) 
  < 4. Company name and data (response)
 < 5. Company Created (response) with data.  

 

I would say that its very unlikely to get what you want in this case. You simply have to make a second call and hope that hubspot has completed step 3 and 4 in time. 

 

 



Need further help with integrations or business development?



Want to help me?

Go to the following links and read through the ideas. If you like them - give the idea an upvote

Upvote the following ideas:

0 Upvotes
TitiCuisset
Community Manager
Community Manager

Creating a new company via API works fine, but initial return company name is empty

SOLVE

Hi @DBilbija 

 

Thank you for reaching out.

 

I want to tag some of our experts on this @frederic_Marken @MichaelC do you have any thoughts on this for @DBilbija ?

 

Thank you!

Best

Tiphaine


Join us on March 27th at 12 PM for the Digital Essentials Lab, an interactive session designed to redefine your digital strategy!
Engage with expert Jourdan Guyton to gain actionable insights, participate in live Q&A, and learn strategies to boost your business success.
Don't miss this opportunity to connect and grow—reserve your spot today!

0 Upvotes