# Users

<div class="section route">

<div class="primary">

## Schema

The schema defines all the fields that exist within a user record. Any response from these endpoints can be expected to contain the fields below unless the \`\_filter\` query parameter is used or the schema field only appears in a specific context.

<table class="attributes">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr id="schema-id">
<td><code>id</code></td>
<td>Unique identifier for the user.
<p>JSON data type: integer</p>
<p>Read only</p>
<p>Context: <code>embed</code>, <code>view</code>, <code>edit</code></p></td>
</tr>
<tr id="schema-username">
<td><code>username</code></td>
<td>Login name for the user.
<p>JSON data type: string</p>
<p>Context: <code>edit</code></p></td>
</tr>
<tr id="schema-name">
<td><code>name</code></td>
<td>Display name for the user.
<p>JSON data type: string</p>
<p>Context: <code>embed</code>, <code>view</code>, <code>edit</code></p></td>
</tr>
<tr id="schema-first_name">
<td><code>first_name</code></td>
<td>First name for the user.
<p>JSON data type: string</p>
<p>Context: <code>edit</code></p></td>
</tr>
<tr id="schema-last_name">
<td><code>last_name</code></td>
<td>Last name for the user.
<p>JSON data type: string</p>
<p>Context: <code>edit</code></p></td>
</tr>
<tr id="schema-email">
<td><code>email</code></td>
<td>The email address for the user.
<p>JSON data type: string,<br />
Format: email</p>
<p>Context: <code>edit</code></p></td>
</tr>
<tr id="schema-url">
<td><code>url</code></td>
<td>URL of the user.
<p>JSON data type: string,<br />
Format: uri</p>
<p>Context: <code>embed</code>, <code>view</code>, <code>edit</code></p></td>
</tr>
<tr id="schema-description">
<td><code>description</code></td>
<td>Description of the user.
<p>JSON data type: string</p>
<p>Context: <code>embed</code>, <code>view</code>, <code>edit</code></p></td>
</tr>
<tr id="schema-link">
<td><code>link</code></td>
<td>Author URL of the user.
<p>JSON data type: string,<br />
Format: uri</p>
<p>Read only</p>
<p>Context: <code>embed</code>, <code>view</code>, <code>edit</code></p></td>
</tr>
<tr id="schema-locale">
<td><code>locale</code></td>
<td>Locale for the user.
<p>JSON data type: string</p>
<p>Context: <code>edit</code></p>
<p>One of: , <code>en_US</code></p></td>
</tr>
<tr id="schema-nickname">
<td><code>nickname</code></td>
<td>The nickname for the user.
<p>JSON data type: string</p>
<p>Context: <code>edit</code></p></td>
</tr>
<tr id="schema-slug">
<td><code>slug</code></td>
<td>An alphanumeric identifier for the user.
<p>JSON data type: string</p>
<p>Context: <code>embed</code>, <code>view</code>, <code>edit</code></p></td>
</tr>
<tr id="schema-registered_date">
<td><code>registered_date</code></td>
<td>Registration date for the user.
<p>JSON data type: string,<br />
Format: datetime (<a href="https://core.trac.wordpress.org/ticket/41032">details</a>)</p>
<p>Read only</p>
<p>Context: <code>edit</code></p></td>
</tr>
<tr id="schema-roles">
<td><code>roles</code></td>
<td>Roles assigned to the user.
<p>JSON data type: array</p>
<p>Context: <code>edit</code></p></td>
</tr>
<tr id="schema-password">
<td><code>password</code></td>
<td>Password for the user (never included).
<p>JSON data type: string</p>
<p>Context:</p></td>
</tr>
<tr id="schema-capabilities">
<td><code>capabilities</code></td>
<td>All capabilities assigned to the user.
<p>JSON data type: object</p>
<p>Read only</p>
<p>Context: <code>edit</code></p></td>
</tr>
<tr id="schema-extra_capabilities">
<td><code>extra_capabilities</code></td>
<td>Any extra capabilities assigned to the user.
<p>JSON data type: object</p>
<p>Read only</p>
<p>Context: <code>edit</code></p></td>
</tr>
<tr id="schema-avatar_urls">
<td><code>avatar_urls</code></td>
<td>Avatar URLs for the user.
<p>JSON data type: object</p>
<p>Read only</p>
<p>Context: <code>embed</code>, <code>view</code>, <code>edit</code></p></td>
</tr>
<tr id="schema-meta">
<td><code>meta</code></td>
<td>Meta fields.
<p>JSON data type: object</p>
<p>Context: <code>view</code>, <code>edit</code></p></td>
</tr>
</tbody>
</table>

</div>

</div>

<div>

<div class="section route">

<div class="primary">

## List Users

Query this endpoint to retrieve a collection of users. The response you receive can be controlled and filtered using the URL query parameters below.

### Definition

`GET /wp/v2/users`

### Example Request

`$ curl https://example.com/wp-json/wp/v2/users`

</div>

<div class="secondary">

### Arguments

<table class="arguments">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr>
<td><code>context</code></td>
<td>Scope under which the request is made; determines fields present in response.
<p>Default: <code>view</code></p>
<p>One of: <code>view</code>, <code>embed</code>, <code>edit</code></p></td>
</tr>
<tr>
<td><code>page</code></td>
<td>Current page of the collection.
<p>Default: <code>1</code></p></td>
</tr>
<tr>
<td><code>per_page</code></td>
<td>Maximum number of items to be returned in result set.
<p>Default: <code>10</code></p></td>
</tr>
<tr>
<td><code>search</code></td>
<td>Limit results to those matching a string.</td>
</tr>
<tr>
<td><code>exclude</code></td>
<td>Ensure result set excludes specific IDs.</td>
</tr>
<tr>
<td><code>include</code></td>
<td>Limit result set to specific IDs.</td>
</tr>
<tr>
<td><code>offset</code></td>
<td>Offset the result set by a specific number of items.</td>
</tr>
<tr>
<td><code>order</code></td>
<td>Order sort attribute ascending or descending.
<p>Default: <code>asc</code></p>
<p>One of: <code>asc</code>, <code>desc</code></p></td>
</tr>
<tr>
<td><code>orderby</code></td>
<td>Sort collection by user attribute.
<p>Default: <code>name</code></p>
<p>One of: <code>id</code>, <code>include</code>, <code>name</code>, <code>registered_date</code>, <code>slug</code>, <code>include_slugs</code>, <code>email</code>, <code>url</code></p></td>
</tr>
<tr>
<td><code>slug</code></td>
<td>Limit result set to users with one or more specific slugs.</td>
</tr>
<tr>
<td><code>roles</code></td>
<td>Limit result set to users matching at least one specific role provided. Accepts csv list or single role.</td>
</tr>
<tr>
<td><code>capabilities</code></td>
<td>Limit result set to users matching at least one specific capability provided. Accepts csv list or single capability.</td>
</tr>
<tr>
<td><code>who</code></td>
<td>Limit result set to users who are considered authors.<br />
One of: <code>authors</code></td>
</tr>
<tr>
<td><code>has_published_posts</code></td>
<td>Limit result set to users who have published posts.</td>
</tr>
</tbody>
</table>

</div>

</div>

<div class="section route">

<div class="primary">

## Create a User

### Arguments

<table class="arguments">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr>
<td><a href="#schema-username"><code>username</code></a></td>
<td>Login name for the user.
<p>Required: 1</p></td>
</tr>
<tr>
<td><a href="#schema-name"><code>name</code></a></td>
<td>Display name for the user.</td>
</tr>
<tr>
<td><a href="#schema-first_name"><code>first_name</code></a></td>
<td>First name for the user.</td>
</tr>
<tr>
<td><a href="#schema-last_name"><code>last_name</code></a></td>
<td>Last name for the user.</td>
</tr>
<tr>
<td><a href="#schema-email"><code>email</code></a></td>
<td>The email address for the user.
<p>Required: 1</p></td>
</tr>
<tr>
<td><a href="#schema-url"><code>url</code></a></td>
<td>URL of the user.</td>
</tr>
<tr>
<td><a href="#schema-description"><code>description</code></a></td>
<td>Description of the user.</td>
</tr>
<tr>
<td><a href="#schema-locale"><code>locale</code></a></td>
<td>Locale for the user.<br />
One of: , <code>en_US</code></td>
</tr>
<tr>
<td><a href="#schema-nickname"><code>nickname</code></a></td>
<td>The nickname for the user.</td>
</tr>
<tr>
<td><a href="#schema-slug"><code>slug</code></a></td>
<td>An alphanumeric identifier for the user.</td>
</tr>
<tr>
<td><a href="#schema-roles"><code>roles</code></a></td>
<td>Roles assigned to the user.</td>
</tr>
<tr>
<td><a href="#schema-password"><code>password</code></a></td>
<td>Password for the user (never included).
<p>Required: 1</p></td>
</tr>
<tr>
<td><a href="#schema-meta"><code>meta</code></a></td>
<td>Meta fields.</td>
</tr>
</tbody>
</table>

</div>

<div class="secondary">

### Definition

`POST /wp/v2/users`

</div>

</div>

<div class="section route">

<div class="primary">

## Retrieve a User

### Definition & Example Request

`GET /wp/v2/users/<id>`

Query this endpoint to retrieve a specific user record.

`$ curl https://example.com/wp-json/wp/v2/users/<id>`

</div>

<div class="secondary">

### Arguments

<table class="arguments">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr>
<td><code>id</code></td>
<td>Unique identifier for the user.</td>
</tr>
<tr>
<td><code>context</code></td>
<td>Scope under which the request is made; determines fields present in response.
<p>Default: <code>view</code></p>
<p>One of: <code>view</code>, <code>embed</code>, <code>edit</code></p></td>
</tr>
</tbody>
</table>

</div>

</div>

<div class="section route">

<div class="primary">

## Update a User

### Arguments

<table class="arguments">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr>
<td><a href="#schema-id"><code>id</code></a></td>
<td>Unique identifier for the user.</td>
</tr>
<tr>
<td><a href="#schema-username"><code>username</code></a></td>
<td>Login name for the user.</td>
</tr>
<tr>
<td><a href="#schema-name"><code>name</code></a></td>
<td>Display name for the user.</td>
</tr>
<tr>
<td><a href="#schema-first_name"><code>first_name</code></a></td>
<td>First name for the user.</td>
</tr>
<tr>
<td><a href="#schema-last_name"><code>last_name</code></a></td>
<td>Last name for the user.</td>
</tr>
<tr>
<td><a href="#schema-email"><code>email</code></a></td>
<td>The email address for the user.</td>
</tr>
<tr>
<td><a href="#schema-url"><code>url</code></a></td>
<td>URL of the user.</td>
</tr>
<tr>
<td><a href="#schema-description"><code>description</code></a></td>
<td>Description of the user.</td>
</tr>
<tr>
<td><a href="#schema-locale"><code>locale</code></a></td>
<td>Locale for the user.<br />
One of: , <code>en_US</code></td>
</tr>
<tr>
<td><a href="#schema-nickname"><code>nickname</code></a></td>
<td>The nickname for the user.</td>
</tr>
<tr>
<td><a href="#schema-slug"><code>slug</code></a></td>
<td>An alphanumeric identifier for the user.</td>
</tr>
<tr>
<td><a href="#schema-roles"><code>roles</code></a></td>
<td>Roles assigned to the user.</td>
</tr>
<tr>
<td><a href="#schema-password"><code>password</code></a></td>
<td>Password for the user (never included).</td>
</tr>
<tr>
<td><a href="#schema-meta"><code>meta</code></a></td>
<td>Meta fields.</td>
</tr>
</tbody>
</table>

</div>

<div class="secondary">

### Definition

`POST /wp/v2/users/<id>`

### Example Request

</div>

</div>

<div class="section route">

<div class="primary">

## Delete a User

### Arguments

<table class="arguments">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr>
<td><code>id</code></td>
<td>Unique identifier for the user.</td>
</tr>
<tr>
<td><code>force</code></td>
<td>Required to be true, as users do not support trashing.</td>
</tr>
<tr>
<td><code>reassign</code></td>
<td>Reassign the deleted user’s posts and links to this user ID.
<p>Required: 1</p></td>
</tr>
</tbody>
</table>

</div>

<div class="secondary">

### Definition

`DELETE /wp/v2/users/<id>`

### Example Request

`$ curl -X DELETE https://example.com/wp-json/wp/v2/users/<id>`

</div>

</div>

<div class="section route">

<div class="primary">

## Retrieve a User

### Definition & Example Request

`GET /wp/v2/users/me`

Query this endpoint to retrieve a specific user record.

`$ curl https://example.com/wp-json/wp/v2/users/me`

</div>

<div class="secondary">

### Arguments

<table class="arguments">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr>
<td><code>context</code></td>
<td>Scope under which the request is made; determines fields present in response.
<p>Default: <code>view</code></p>
<p>One of: <code>view</code>, <code>embed</code>, <code>edit</code></p></td>
</tr>
</tbody>
</table>

</div>

</div>

<div class="section route">

<div class="primary">

## Update a User

### Arguments

<table class="arguments">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr>
<td><a href="#schema-username"><code>username</code></a></td>
<td>Login name for the user.</td>
</tr>
<tr>
<td><a href="#schema-name"><code>name</code></a></td>
<td>Display name for the user.</td>
</tr>
<tr>
<td><a href="#schema-first_name"><code>first_name</code></a></td>
<td>First name for the user.</td>
</tr>
<tr>
<td><a href="#schema-last_name"><code>last_name</code></a></td>
<td>Last name for the user.</td>
</tr>
<tr>
<td><a href="#schema-email"><code>email</code></a></td>
<td>The email address for the user.</td>
</tr>
<tr>
<td><a href="#schema-url"><code>url</code></a></td>
<td>URL of the user.</td>
</tr>
<tr>
<td><a href="#schema-description"><code>description</code></a></td>
<td>Description of the user.</td>
</tr>
<tr>
<td><a href="#schema-locale"><code>locale</code></a></td>
<td>Locale for the user.<br />
One of: , <code>en_US</code></td>
</tr>
<tr>
<td><a href="#schema-nickname"><code>nickname</code></a></td>
<td>The nickname for the user.</td>
</tr>
<tr>
<td><a href="#schema-slug"><code>slug</code></a></td>
<td>An alphanumeric identifier for the user.</td>
</tr>
<tr>
<td><a href="#schema-roles"><code>roles</code></a></td>
<td>Roles assigned to the user.</td>
</tr>
<tr>
<td><a href="#schema-password"><code>password</code></a></td>
<td>Password for the user (never included).</td>
</tr>
<tr>
<td><a href="#schema-meta"><code>meta</code></a></td>
<td>Meta fields.</td>
</tr>
</tbody>
</table>

</div>

<div class="secondary">

### Definition

`POST /wp/v2/users/me`

### Example Request

</div>

</div>

<div class="section route">

<div class="primary">

## Delete a User

### Arguments

<table class="arguments">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr>
<td><code>force</code></td>
<td>Required to be true, as users do not support trashing.</td>
</tr>
<tr>
<td><code>reassign</code></td>
<td>Reassign the deleted user’s posts and links to this user ID.
<p>Required: 1</p></td>
</tr>
</tbody>
</table>

</div>

<div class="secondary">

### Definition

`DELETE /wp/v2/users/me`

### Example Request

`$ curl -X DELETE https://example.com/wp-json/wp/v2/users/me`

</div>

</div>

</div>