Filter by custom field of a company

Hi,

I try to filter companies by their values of a custom field. For this I use the /crm/v3/objects/companies/search endpoint and add the following body:

{
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "helloHQSystemUrl",
 "operator": "EQ",
 "value": "hq.hellohq.io"
 }
 ]
 }
 ]
}

helloHQSystemUrl is a custom field.
I get and error back:

{
	"status": "error",
	"message": "There was a problem with the request.",
	"correlationId": "e9004514-cfa0-419b-9c54-7a90ee311ea6"
}

When I change helloHQSystemUrl to name for example, then the request works…

What do I wrong?

Best

Sven

Hey, @Svenson :waving_hand: Did you get this worked out? If not, I have a few questions and a suggestion.

Questions:

  • Can you navigate to Settings > Properties > Companies and search for your property, please?

helloHQSystemUrl

  • From there, click on the “</>” icon and note the internal value for the property. Is it lowercase? (screenshot from my portal and quick test)

  • If so, can you re-try your request using the all lowercase value, please?
  • If not, will you add a screenshot like mine showing the internal value in mixed case, please?

Example using my portal:

  • I used the custom Company property from above and assigned it to one of my test Companies — Bob’s Burger’s

  • I used Postman to make a similar request to your example:
    Request
    POST https://api.hubapi.com/crm/v3/objects/companies/search​
    Body

    {"filterGroups":[{
     "filters":[
     {
     "propertyName":"hellohqsystemurl",
     "operator":"EQ",
     "value":"hq.hellohq.io"
     }
    ]
    }
    ]
    }​
    

    Response (success!)

    {
     "total": 1,
     "results": [
     {
     "id": "10202231613",
     "properties": {
     "createdate": "2022-11-29T19:11:33.392Z",
     "domain": "bobsburgers.com",
     "hs_lastmodifieddate": "2023-05-31T00:50:43.511Z",
     "hs_object_id": "10202231613",
     "name": "Bob's Burgers"
     },
     "createdAt": "2022-11-29T19:11:33.392Z",
     "updatedAt": "2023-05-31T00:50:43.511Z",
     "archived": false
     }
     ]
    }​
    

Thanks for the additional information! — Jaycee

Hi @Jaycee_Lewis,
works ;). Thank you very much.

Have a great day.

Best

Sven