Admin API - get all users with custom attributes

Hi all
in the Keycloak Admin API under the “users” section there is an option to filter results by custom attributes

from the documentation:

however this doesn’t seem to work fo me.
i created a user with the following attribute:

when I send:
http://localhost:8080/auth/admin/realms/myRealm/users?q='isSuperUser: true’ with postman I get nothing.
if I send without the q parameters I see all users

Does anyone know what is the problem?

Try dropping the single quotes and urlencoding the string. E.g. isSuperUser%3Atrue

@xgp thanks a lot dude. this helps.

actually, you don’t even have too use urlencoding
this URL is working fine in POSTMAN for a user with 3 attributes
just need to separate the attributes with spaces

“{{keycloak_url}}/admin/realms/{{realm}}/users?q=isSuperUser:true k1:v1 k2v2”

1 Like