Auth0 Home Blog Docs

GET /api/v2/users :: querying for values in user_metadata

api
management-api
api-v2

#1

Description

When using the API “GET /api/v2/users” it is not working as expected when using the “q” parameter to specify a Lucene query to select a custom value in “user_metadata”.

Our user_metadata looks like:
{ tier: number, ... }

Some examples that return an empty list when I would expect some users:

curl -H "Authorization: Bearer $AUTH0_TOKEN" "https://$AUTH0_DOMAIN.auth0.com/api/v2/users?q=user_metadata.tier:1"

curl -H "Authorization: Bearer $AUTH0_TOKEN" "https://$AUTH0_DOMAIN.auth0.com/api/v2/users?q=_exists_:user_metadata.tier"

Open Question

Is there a limited subset of user_metadata that is available for querying? It’s very unclear why I can reliably query q=_exists_:user.metadata.name but not a “custom” value like tier


#2

Seems that there are limits to what you can search in user_metadata after all.
https://auth0.com/docs/metadata#searching-metadata

Would be nice if the API docs also included the above link.


#3