• [Wébinaire 13 novembre 2025] Comment l’IA optimise la performance marketing in HubSpot ?

    S'inscrire

APIs & Integrations

KevinL33
Membre

Search for Companies by Domain returns Method Not Allowed

Résolue

HI all, I'm trying to use the function Search For Companies by domain, documented here:

https://legacydocs.hubspot.com/docs/methods/companies/search_companies_by_domain

 

But I always receive:

HTTP Error 405 

Method Not Allowed.

 

Has the function been deprecated? If so is there a current replacement for it?

 

Kevin.

0 Votes
1 Solution acceptée
dennisedson
Solution
Gestionnaire de communauté
Gestionnaire de communauté

Search for Companies by Domain returns Method Not Allowed

Résolue

ah, 

That would be expected then.

2 problems:

1.  you need to use your hapikey to get results specific for your portal

2.  the browser can only make get requests where this endpoint requires a post request. 

You can download postman or an equivalent to test this.


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

Voir la solution dans l'envoi d'origine

0 Votes
7 Réponses
KevinL33
Membre

Search for Companies by Domain returns Method Not Allowed

Résolue

Hi @dennisedson I post the url from the demo, or I can put in one of our client contact domains with my apikey and get the same result

 

https://api.hubapi.com/companies/v2/domains/hubspot.com/companies?hapikey=demo


0 Votes
KevinL33
Membre

Search for Companies by Domain returns Method Not Allowed

Résolue

I should mention that I'm entering the url on a web browser and just viewing the Json that's returned ( if it's returned).

 

0 Votes
dennisedson
Solution
Gestionnaire de communauté
Gestionnaire de communauté

Search for Companies by Domain returns Method Not Allowed

Résolue

ah, 

That would be expected then.

2 problems:

1.  you need to use your hapikey to get results specific for your portal

2.  the browser can only make get requests where this endpoint requires a post request. 

You can download postman or an equivalent to test this.


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

0 Votes
KevinL33
Membre

Search for Companies by Domain returns Method Not Allowed

Résolue

Thanks for the info @dennisedson .  I actually installed the c# package HubSpot.NET and used the functions api.Company.GetByDomain() and api.Company.GetById().  Both work like a charm. Thanks again.  KL.

KevinL33
Membre

Search for Companies by Domain returns Method Not Allowed

Résolue

Hi @Teun   I am using an API key, the demo example doesn't even work.  If you follow my link and copy/paste the example URL you'll see the same error.

 

0 Votes
dennisedson
Gestionnaire de communauté
Gestionnaire de communauté

Search for Companies by Domain returns Method Not Allowed

Résolue

@KevinL33 ,

I just tested in postman and it works for me 🤔

Can you post exactly what you are sending? (minus your hapikey)


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

0 Votes
Teun
Expert reconnu | Partenaire solutions Elite
Expert reconnu | Partenaire solutions Elite

Search for Companies by Domain returns Method Not Allowed

Résolue

Hi @KevinL33 ,

 

Do you use oAuth2 or the API key? If you use oAuth2, check if you have the correct scopes (contacts) in place. 



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.