# Read companies using idProperty returning 404

**URL:** <https://community.hubspot.com/t/read-companies-using-idproperty-returning-404/44415>\
**Category:** APIs & Integrations\
**Tags:** companies\
**Created:** [September 27, 2021, 2:27pm UTC](https://community.hubspot.com/t/read-companies-using-idproperty-returning-404/44415 "2021-09-27T14:27:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RFrance](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rfrance/32/76463_2.png) [@RFrance](https://community.hubspot.com/u/RFrance)\
**Post date:** [September 27, 2021, 2:27pm UTC](https://community.hubspot.com/t/read-companies-using-idproperty-returning-404/44415/1 "2021-09-27T14:27:40Z")

</div>

Hello,

I am trying to return a specific company based on it’s name, I have set idProperty on this to be ‘name’ and you can see the call I am making below:

`https://api.hubapi.com/crm/v3/objects/companies/Melt%20Industries?archived=false&idProperty=name&hapikey=`

I realise this needs to be a unique property but having done a similar thing with ‘Contacts’ I figure this should work too? Ideally I need to be able to pass the company name into this call and not the actual company ID.

Any help would be appreciated.

Thanks,

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [September 27, 2021, 8:15pm UTC](https://community.hubspot.com/t/read-companies-using-idproperty-returning-404/44415/2 "2021-09-27T20:15:39Z")

</div>

@RFrance

I would suggest employing the [CRM Search](https://developers.hubspot.com/docs/api/crm/search) endpoint

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [September 28, 2021, 12:48pm UTC](https://community.hubspot.com/t/read-companies-using-idproperty-returning-404/44415/3 "2021-09-28T12:48:38Z")

</div>

Hi @RFrance ,  
You can search the company with using name via HubSpot api.  
Node.JS code :  
const request = require(“request”);  
var options = { method: ‘POST’,  
url: ‘[https://api.hubapi.com/crm/v3/objects/companies/search](https://api.hubapi.com/crm/v3/objects/companies/search)’,  
qs: { hapikey: ‘HubSpotAPIKey’ },  
headers:  
{  
‘Content-Type’: ‘application/json’ },  
body: {  
“filterGroups”:[  
{  
“filters”:[  
{  
“propertyName”: “name”,  
“operator”: “EQ”,  
“value”: “Melt Industries”  
}  
]  
}  
]  
},  
json: true };  
request(options, function (error, response, body) {  
if (error) throw new Error(error);  
console.log(body);  
});

Hope this helps!

If we were able to answer your query, kindly help the community by marking it as a solution.  
Thanks and Regards.

---

<div class="post-metadata">

**Author:** ![RFrance](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rfrance/32/76463_2.png) [@RFrance](https://community.hubspot.com/u/RFrance)\
**Post date:** [September 28, 2021, 3:04pm UTC](https://community.hubspot.com/t/read-companies-using-idproperty-returning-404/44415/4 "2021-09-28T15:04:44Z")

</div>

Thanks, using the search endpoint was successful.

Any reason why idProperty in this instance was not working? It works for ‘Contacts’ endpoints. Is this a potential bug with the read endpoint?

---

<div class="post-metadata">

**Author:** ![RNoecker](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@RNoecker](https://community.hubspot.com/u/RNoecker)\
**Post date:** [November 9, 2021, 3:27pm UTC](https://community.hubspot.com/t/read-companies-using-idproperty-returning-404/44415/5 "2021-11-09T15:27:04Z")

</div>

I am having this same issue, and also noticed that it seems to work with contacts. It returns a 404 with HTML content. If you specify a string and don’t set an id property you at least get Json with an “object not found” message. This makes me assume setting an id property along with a string is valid and it just isn’t finding anything despite the value being valid. I don’t know if there is anything with the uniqueness constraint and whether that needs to be enabled for the property, but I can guarantee the values will be unique on my side, and there is only a single company at this time for testing.

Another interesting thing is that idProperty can be set to an invalid property and it doesn’t validate it. Due to that, I can’t say for sure whether the property is actually being recognized as valid, although it is as I can get that custom property back in the object when retrieving it by the object ID.
