Get org_id from UpdateHumanUser event
I'm using the Actions v2 to listen to some Requests. On my problem, I need to get the user metadata when the UpdateHumanUser is called. For getting the metadata we need to call the get user metadata endpoint. To do that we need to pass the org_id of the user in question if the caller user and the user we want the metadata from belong to a different org (usually my case).
The payload from the Request we get is bellow
The problem is that the org_id from the payload is the org_id from the user making the call not the user been changed.
Is there any way I can retrieve the org_id based on a user_id? I looked at the API but the get user by id or search user don't see to return the org_id of the user
Request payload:
2 Replies
For anyone interested in the solution, if you call get user by id the user.details.resourceOwner will be the org_id
ZITADEL Docs
Returns the full user object (human or machine) including the profile, email, etc..
🎉 Looks like you just helped out another community member! Thanks for being so helpful <@1384812747308531775>! You're now one step closer to leveling up—keep up the amazing peer support! 🚀