APIs & Integrations

Egoi
Contributor | Partner
Contributor | Partner

How to use search API for Users

SOLVE

I´m trying to find the way to properly use the Users API. I have already used search endpoints on objects without any problem, but cannot make it work for Users.

The endpoint is this: /crm/v3/objects/users/search

And the body I am using as an example is this:

{
  "filters": [
    {
      "propertyName": "firstname",
      "operator": "EQ",
      "value": "Eg"
    }
  ]
}


But does not work:

{
	"status": "error",
	"message": "There was a problem with the request.",
	"correlationId": "d16119b2-8ee8-4035-888f-b630a52362af"
}

 
Any advice?

Thank you!

1 Accepted solution
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

How to use search API for Users

SOLVE

Hi @Egoi 

 

Please use the following json:

 

{
  "properties": [
    "hs_given_name","hs_family_name","hs_email"
  ],
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_given_name",
          "value": "Eg",
          "operator": "EQ"
        }
      ]
    }
  ]
}

 

Here hs_given_name is an api name for user's firstname.
hs_family_name is an api name for user's lastname.
hs_email is an api name for user's email address.

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


View solution in original post

3 Replies 3
Jaycee_Lewis
Community Manager
Community Manager

How to use search API for Users

SOLVE

Hey, @Egoi You can make a request to the Properties API to all the available properties and their internal values:

curl --request GET \
  --url 'https://api.hubapi.com/crm/v3/properties/users?archived=false' \
  --header 'authorization: Bearer YOUR_ACCESS_TOKEN'

 

Best,

Jaycee

 

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
GRajput
Solution
Recognized Expert | Platinum Partner
Recognized Expert | Platinum Partner

How to use search API for Users

SOLVE

Hi @Egoi 

 

Please use the following json:

 

{
  "properties": [
    "hs_given_name","hs_family_name","hs_email"
  ],
  "filterGroups": [
    {
      "filters": [
        {
          "propertyName": "hs_given_name",
          "value": "Eg",
          "operator": "EQ"
        }
      ]
    }
  ]
}

 

Here hs_given_name is an api name for user's firstname.
hs_family_name is an api name for user's lastname.
hs_email is an api name for user's email address.

 

I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!




Gaurav Rajput
Director, MarTech( Growth Natives)

Book a meeting


danielthomas23
Participant

How to use search API for Users

SOLVE

Thank you Gaurav, this was helpful for me to understand what hubspot calls the property names. I knew email and title from the API endpoints within the documentation, but no mention of how to get the name. As user isnt listed as an object in settings we cant search through there either.

 

I'm curious if there is documnetation anywhere that lists all the properties related to user

0 Upvotes