I have been using GET .eu.auth0.com/api/v2/users to read up to date list of users in my tenant for a coouple of months. It worked like a charm, but recently I have noticed that it started returning stale data:
When new user registers it is immediately included into the list returned by v2/users API and all the data is correct.
If user updates information about himself, e.g verifies e-mail, then GET /v2/users continue to return old data. The values themselves are stale as well as updated_at attribute: all of them match values at user creation.
3)If I open the same user in Auth0 console, I see correct values and correct timestamps.
To everyone: If you are experiencing the same stale data, I have found a way to manually invalidate the cache and force all updates to be picked up. To do this you may update some “fake” property in “app_metadata”, and apparently this forces user list to return correct information.
Assuming that you have list of user ids with problems in file /tmp/users and valid token in TKN variable, the command like below may help:
bash> for u in `cat /tmp/users`;do curl -X PATCH -H “Authorization: Bearer $TKN” -H “Content-Type: application/json” -d ‘{“app_metadata”:{“enforce_refresh”:1}}’ “https://>your_domain.eu.auth0.com/api/v2/users/${u}”;done