APIs & Integrations

5c0tt
Member

Help with deleting company - Delete Company API question

SOLVE

Hi, I might be doing something wrong, misunderstanding the API, or the doc is wrong, please can you help?

The API reference for delete a company shows the same URL as for return a company:

https://developers.hubspot.com/docs/methods/companies/delete_company  shows:

Example DELETE URL:
https://api.hubapi.com/companies/v2/companies/10444744?hapikey=demo

https://developers.hubspot.com/docs/methods/companies/get_company

Example GET URL:
https://api.hubapi.com/companies/v2/companies/10444744?hapikey=demo

What am I missing? how do I delete a company?

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Help with deleting company - Delete Company API question

SOLVE

Hi @5c0tt,

 

I hope all is well with you 🙂

 

You're right to say that both the delete and get company endpoint is using the same URLs, however the HTTP methods are different. 

 

The Delete company endpoint is using a HTTP Methods - Delete where it'll delete the resource at the specified URL. 

 

The Get company endpoint is using a HTTP Methods - Get where it is used to retreive data from a server at the specified resource. 

 

When looking to delete a company, you'll have to change the HTTP method to Delete.

 

Additionally, I'd love to share with you this useful documentation about HTTP request methods.

 

Hope this helps to clarify!

View solution in original post

0 Upvotes
2 Replies 2
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Help with deleting company - Delete Company API question

SOLVE

Hi @5c0tt,

 

I hope all is well with you 🙂

 

You're right to say that both the delete and get company endpoint is using the same URLs, however the HTTP methods are different. 

 

The Delete company endpoint is using a HTTP Methods - Delete where it'll delete the resource at the specified URL. 

 

The Get company endpoint is using a HTTP Methods - Get where it is used to retreive data from a server at the specified resource. 

 

When looking to delete a company, you'll have to change the HTTP method to Delete.

 

Additionally, I'd love to share with you this useful documentation about HTTP request methods.

 

Hope this helps to clarify!

0 Upvotes
5c0tt
Member

Help with deleting company - Delete Company API question

SOLVE
Oh! Of course. So sorry, it’s obvious now
0 Upvotes