How to Filter Users by Team ID Using the Users Search API

I am working with the Users Search API and want to filter users based on their team ID. In the API response, I receive the following fields

  • primaryTeamId: “55685825”
  • secondaryTeamIds: [“55681645”]

My goal is to retrieve all users belonging to a specific team ID. How should I structure my query to get all the users associated with a particular team (whether it’s their primary or secondary team)?

Any help or guidance would be greatly appreciated!

@SudheerN - for a similar type of challenge in one of my recent projects, I started using the Team API call:
https://api.hubapi.com/settings/v3/users/teams

This returns the user IDs who are primary and secondary to each team - so it’s easy to loop through to build a lits of all teams with which a user has one or other membership.

Hope this helps!

Steve