I need to get a list of users by specific role.
I user this endpoint:

GET /users?roles=customer

but I got:

"code": "rest_user_cannot_view",
"message": "Sorry, you are not allowed to filter users by role",
"data": {
    "status": 403

If I use "GET /users" works, but I have not the result I would and moreover I can't see all user in DB

  • The message says you are not allowed to filter users by their role, what is the role of the current user? – Tom J Nowell Sep 2 at 21:27
  • Filtering users by role requires authentication and the user making the API request also needs the list_users capability. – Sally CJ Sep 4 at 1:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.