The wp-json/wp/v2/users
endpoint is part of the WordPress REST API, which was introduced with WordPress version 4.7, released on December 6, 20161. This endpoint provides access to user data through a JSON format, facilitating interaction between different systems or applications and WordPress without needing to navigate through the traditional WordPress admin interface.
The /wp/v2/users
endpoint allows developers to:
Developers can interact with this endpoint using HTTP methods:
/wp-json/wp/v2/users
will return a list of all users if the requester has the necessary permissions2.Access to user data via this endpoint is controlled by WordPress's built-in capabilities system:
list_users
capability can retrieve the list of users.create_users
, edit_users
, or delete_users
, respectively._fields
parameter3.Here are some example requests:
GET /wp-json/wp/v2/users
- List all users.GET /wp-json/wp/v2/users/1
- Retrieve details for user ID 1.POST /wp-json/wp/v2/users
with JSON data to create a new user.The wp-json/wp/v2/users
endpoint is part of WordPress's move towards a more API-driven development environment. It allows developers to build applications that integrate seamlessly with WordPress, leveraging its content and user management capabilities without being tied to the WordPress frontend4.