get-users
Retrieve a filtered list of WordPress users by role, capabilities, or specific attributes using site credentials, enabling precise user management via REST API.
Instructions
Get a list of users from a WordPress site with advanced filtering options
Input Schema
Name | Required | Description | Default |
---|---|---|---|
capabilities | No | Limit result set to users matching at least one specific capability | |
context | No | Scope under which the request is made | view |
exclude | No | Ensure result set excludes specific IDs | |
hasPublishedPosts | No | Limit result set to users who have published posts | |
include | No | Limit result set to specific IDs | |
offset | No | Offset the result set by a specific number of items | |
order | No | Order sort attribute ascending or descending | asc |
orderby | No | Sort collection by user attribute | name |
page | No | Current page of the collection | |
password | Yes | WordPress application password | |
perPage | No | Maximum number of items to be returned | |
roles | No | Limit result set to users matching at least one specific role | |
search | No | Limit results to those matching a string | |
siteUrl | Yes | WordPress site URL | |
slug | No | Limit result set to users with one or more specific slugs | |
username | Yes | WordPress username | |
who | No | Limit result set to users who are considered authors |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"capabilities": {
"description": "Limit result set to users matching at least one specific capability",
"items": {
"type": "string"
},
"type": "array"
},
"context": {
"default": "view",
"description": "Scope under which the request is made",
"enum": [
"view",
"embed",
"edit"
],
"type": "string"
},
"exclude": {
"description": "Ensure result set excludes specific IDs",
"items": {
"type": "number"
},
"type": "array"
},
"hasPublishedPosts": {
"description": "Limit result set to users who have published posts",
"type": "boolean"
},
"include": {
"description": "Limit result set to specific IDs",
"items": {
"type": "number"
},
"type": "array"
},
"offset": {
"description": "Offset the result set by a specific number of items",
"type": "number"
},
"order": {
"default": "asc",
"description": "Order sort attribute ascending or descending",
"enum": [
"asc",
"desc"
],
"type": "string"
},
"orderby": {
"default": "name",
"description": "Sort collection by user attribute",
"enum": [
"id",
"include",
"name",
"registered_date",
"slug",
"include_slugs",
"email",
"url"
],
"type": "string"
},
"page": {
"default": 1,
"description": "Current page of the collection",
"minimum": 1,
"type": "number"
},
"password": {
"description": "WordPress application password",
"type": "string"
},
"perPage": {
"default": 10,
"description": "Maximum number of items to be returned",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"roles": {
"description": "Limit result set to users matching at least one specific role",
"items": {
"type": "string"
},
"type": "array"
},
"search": {
"description": "Limit results to those matching a string",
"type": "string"
},
"siteUrl": {
"description": "WordPress site URL",
"format": "uri",
"type": "string"
},
"slug": {
"description": "Limit result set to users with one or more specific slugs",
"items": {
"type": "string"
},
"type": "array"
},
"username": {
"description": "WordPress username",
"type": "string"
},
"who": {
"description": "Limit result set to users who are considered authors",
"enum": [
"authors"
],
"type": "string"
}
},
"required": [
"siteUrl",
"username",
"password"
],
"type": "object"
}