Search code examples
google-apigoogle-admin-sdkgoogle-directory-api

User list api with query for org unit also gives sub org unit users


I'm using the api call like /admin/directory/v1/users?domain=domain.com&query=orgUnitPath=/Sales and users in that org unit but say I also have a sub orgunit like /Sales/California and more users there. Is there a way to only get the users in /Sales and not the sub org units?


Solution

  • No, you need to filter locally on the specific OrgUnit you want.