How to get Tenant Member by user_id

Hi! We got a user_id from the Auth0 (Audit) Logs (query type:sapi or Filter API Operation). But how do we get which Tenant Member is the user_id for? Thanks!

hi @jan.paologo
You should be able to query the user search endpoint or within the dashboard to pull up the tenant member the user_id is associated to.

Thanks for helping on this one @yoav! :bowing_man:

Hello yoav, I tried user search endpoint but it only returns actual users (and not tenant members). Is this the dashboard?

If you wouldn’t mind sending more details or docs. Thank you!

This is what we tried and didn’t work on the user_id of a tenant member

token="REDACTED"
user_id="REDACTED"
curl -L "https://1stbet.auth0.com/api/v2/users?q=user_id:$user_id" -H "Accept: application/json" -H "Authorization: Bearer $token"

We verified that the command and token are correct by using a user_id of an actual Auth0 user (not a tenant member).
We need to get user info of a tenant member

Hi @jan.paologo,

Thanks for the reply.

The user_id attribute is only meant for actual users on your tenant and not for tenant members.

In fact, there is no way to get a tenant member’s user info using the Management API.

If you need to find this information, you can go to the Auth0 Dashboard > Settings > Tenant Members.

I hope this helps!

Let me know if you have any questions.

Thanks,
Rueben

Hello Rueben, The Tenant Members page does not show user_id though. How can we know which Tenant Member is the user_id for?

This is where we got the user_id of the Tenant Member

Hi @jan.paologo,

Thanks for the replies.

In your logs, there should be an "auth" object that holds information about the user, such as the user_id and email.

AFAIK, there doesn’t seem to be any way to query the user_id of tenant members. However, you should be able to see the user’s email and determine which tenant member performed those changes.

Thanks,
Rueben

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.