auth0.v3.management.users.Users returns stale data immediately after a successful role update

Hi @harit,

Welcome to the Auth0 Community!

The behavior you have described above is the expected one, since methods such as Users.list are eventually consistent, meaning that it will take some time for all the changes to be visible when inspecting the user object. You can check out this community post on the matter.

So if you want to pursue an approach that is instantly available, i would recommend fetching a Management API Access Tokens and make a call to an endpoint such as the GET /v2/users/{id} or the GET /v2/users-by-email endpoint, which are immediately consistent.

I hope this helps!
Thanks,
Remus