When I hit: https://example.com/wp-json/wp/v2/users

I am getting response:

"code": "rest_user_cannot_view",
"message": "Sorry, you are not allowed to list users.",
"data": {
"status": 401

I am able to view users in admin and via REST API I can create and modify posts so I am authenticated but for some reason I am unable to list users. This user has administrator role.

Anyone know what issue could be?

  • Are you authenticated to the REST API before attempting to see the users? Being logged in to wp-admin doesn't necessarily mean you've authenticated to the REST API.
    – Pat J
    Commented Aug 21, 2021 at 18:44

1 Answer 1


I discovered it was wordfence plugin. It blocks this endpoint.

You can disable it with this option:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.