Schema
The schema defines all the fields that exist for a user object.
idinteger |
Unique identifier for the user. Read only Context: |
usernamestring |
Login name for the user. Context: |
namestring |
Display name for the user. Context: |
first_namestring |
First name for the user. Context: |
last_namestring |
Last name for the user. Context: |
emailstring, email |
The email address for the user. Context: |
urlstring, uri |
URL of the user. Context: |
descriptionstring |
Description of the user. Context: |
linkstring, uri |
Author URL of the user. Read only Context: |
localestring |
Locale for the user. Context: One of: |
nicknamestring |
The nickname for the user. Context: |
slugstring |
An alphanumeric identifier for the user. Context: |
registered_datestring, datetime (ISO8601) |
Registration date for the user. Read only Context: |
rolesarray |
Roles assigned to the user. Context: |
passwordstring |
Password for the user (never included). Context: |
capabilitiesobject |
All capabilities assigned to the user. Read only Context: |
extra_capabilitiesobject |
Any extra capabilities assigned to the user. Read only Context: |
avatar_urlsobject |
Avatar URLs for the user. Read only Context: |
metaobject |
Meta fields. Context: |
Example Request
$ curl -X OPTIONS -i http://demo.wp-api.org/wp-json/wp/v2/users
List Users
Arguments
context |
Scope under which the request is made; determines fields present in response.
Default: One of: |
page |
Current page of the collection.
Default: |
per_page |
Maximum number of items to be returned in result set.
Default: |
search |
Limit results to those matching a string. |
exclude |
Ensure result set excludes specific IDs.
Default: |
include |
Limit result set to specific IDs.
Default: |
offset |
Offset the result set by a specific number of items. |
order |
Order sort attribute ascending or descending.
Default: One of: |
orderby |
Sort collection by object attribute.
Default: One of: |
slug |
Limit result set to users with a specific slug. |
roles |
Limit result set to users matching at least one specific role provided. Accepts csv list or single role. |
Definition
GET /wp/v2/users
Example Request
$ curl http://demo.wp-api.org/wp-json/wp/v2/users
Retrieve a User
Arguments
context |
Scope under which the request is made; determines fields present in response.
Default: One of: |
Definition
GET /wp/v2/users/<id>
Example Request
$ curl http://demo.wp-api.org/wp-json/wp/v2/users/<id>
Create a User
Arguments
username |
Login name for the user. Required: true |
name |
Display name for the user. |
first_name |
First name for the user. |
last_name |
Last name for the user. |
email |
The email address for the user. Required: true |
url |
URL of the user. |
description |
Description of the user. |
locale |
Locale for the user. One of: |
nickname |
The nickname for the user. |
slug |
An alphanumeric identifier for the user. |
roles |
Roles assigned to the user. |
password |
Password for the user (never included). Required: true |
meta |
Meta fields. |
Definition
POST /wp/v2/users
Update a User
Arguments
username |
Login name for the user. |
name |
Display name for the user. |
first_name |
First name for the user. |
last_name |
Last name for the user. |
email |
The email address for the user. |
url |
URL of the user. |
description |
Description of the user. |
locale |
Locale for the user. One of: |
nickname |
The nickname for the user. |
slug |
An alphanumeric identifier for the user. |
roles |
Roles assigned to the user. |
password |
Password for the user (never included). |
meta |
Meta fields. |
Definition
POST /wp/v2/users/<id>
Example Request
Delete a User
Arguments
force |
Required to be true, as users do not support trashing. |
reassign |
Reassign the deleted user's posts and links to this user ID. |
Definition
DELETE /wp/v2/users/<id>
Example Request
$ curl -X DELETE http://demo.wp-api.org/wp-json/wp/v2/users/<id>