How to search for specific Custom Object Record using API

Hey, I would like to search for a specifc record on a custom object record.

The unique identifier is the email which is the name and require propery on this custom object, could anyone let me know if this is possible?

Hi @AutomateMyBiz :waving_hand:

If you haven’t already, it might be helpful to read HubSpot’s CRM Search API docs. An example request:

Method & Endpoint

POST https://api.hubapi.com/crm/v3/objects/**example**/search

  • Where example is the internal “name” of the custom object

Headers

Content-Type: application/json

Authorization: Bearer YOUR_ACCESS_TOKEN

Body (JSON)

{
 "limit": 100,
 "properties": [
 "test_prop_2",
 "test_prop_3"
 ],
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "test_prop_1",
 "operator": "EQ",
 "value": "example"
 }
 ]
 }
 ]
}
  • The API response will include any example records where test_prop_1 is equal to “example”
  • test_prop_2 and test_prop_3 will be returned in the response per record

I hope this proves useful. Please let me know if you have any follow-up questions.

Hi,

I already checked the solution and it doesn’t work for me.

I tried to get the results via Postman (I’m not using Hubpospot’s collection).

As the first step, I get the names of custom objects by sending a request to https://api.hubapi.com/crm/v3/schemas.
In the next step, I decided to send the request as you suggested so I modified the URL and condition to get only objects modified since the beginning of this year…

{
 "limit": 100,
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "hs_lastmodifieddate",
 "operator": "GT",
 "value": "17357442880"
 }
 ]
 }
 ]
}

but I received an error below

Am I doing something wrong?

The error above I get because of the GET method but after changing to POST I received

{

“status”: “error”,

“message”: “Unable to infer object type from: xxxxxxx (object name)”,

“correlationId”: “a6ff1888-80f3-4a74-958e-0e30bb6c60f9”

}

Hi @CGorczynski :waving_hand:

This usually means your referencing an invalid custom object identifier in your request URL. You can use any of the following custom object schema attributes as your identifier in request URLs:

  1. name (e.g. “example”, case-sensitive, will no longer work starting ~April 2025)
  2. fullyQualifiedName (e.g. “p12345_example”)
  3. objectTypeId (e.g. “2-12345”)
  4. “Short hand” custom object name (e.g. “p_example”)

I hope that helps. Please let me know if you have any follow-up questions.

I have double-checked the name as the potential issue source but I’m sure that name is correct.

But when I used fullyQualifiedName everything worked perfectly :slightly_smiling_face:

Thanks, Zach!