`/wp/v2/users/me`

Namespace: wp/v2
Route: /wp/v2/users/me

Routes

  • Collection: /wp/v2/users/me

HTTP Methods

Collection methods: GET, POST, PUT, PATCH, DELETE

Request Parameters

Collection GET

ParameterTypeRequiredDefaultDescription
contextstringfalseviewScope under which the request is made; determines fields present in response.

Collection POST, PUT, PATCH

ParameterTypeRequiredDefaultDescription
usernamestringfalseLogin name for the user.
namestringfalseDisplay name for the user.
first_namestringfalseFirst name for the user.
last_namestringfalseLast name for the user.
emailstringfalseThe email address for the user.
urlstringfalseURL of the user.
descriptionstringfalseDescription of the user.
localestringfalseLocale for the user.
nicknamestringfalseThe nickname for the user.
slugstringfalseAn alphanumeric identifier for the user.
rolesarrayfalseRoles assigned to the user.
passwordstringfalsePassword for the user (never included).
metaobjectfalseMeta fields.
pending_emailstringfalse
2fa_requiredbooleanfalse
2fa_available_providersarrayfalse
2fa_primary_providerarrayfalse
2fa_backup_codes_remainingintfalse
2fa_revalidationarrayfalse
2fa_webauthn_keysarrayfalse
2fa_webauthn_register_noncearrayfalse
svn_password_requiredbooleanfalse
svn_password_createdboolean, stringfalse

Collection DELETE

ParameterTypeRequiredDefaultDescription
forcebooleanfalseFalseRequired to be true, as users do not support trashing.
reassignintegertrueReassign the deleted user’s posts and links to this user ID.

Response Schema (Item)

FieldTypeDescription
idintegerUnique identifier for the user. (read-only)
usernamestringLogin name for the user.
namestringDisplay name for the user.
first_namestringFirst name for the user.
last_namestringLast name for the user.
emailstringThe email address for the user.
urlstringURL of the user.
descriptionstringDescription of the user.
linkstringAuthor URL of the user. (read-only)
localestringLocale for the user.
nicknamestringThe nickname for the user.
slugstringAn alphanumeric identifier for the user.
registered_datestringRegistration date for the user. (read-only)
rolesarrayRoles assigned to the user.
passwordstringPassword for the user (never included).
capabilitiesobjectAll capabilities assigned to the user. (read-only)
extra_capabilitiesobjectAny extra capabilities assigned to the user. (read-only)
avatar_urlsobjectAvatar URLs for the user. (read-only)
metaobjectMeta fields.
pending_emailstring
2fa_requiredboolean
2fa_available_providersarray
2fa_primary_providerarray
2fa_backup_codes_remainingint
2fa_revalidationarray
2fa_webauthn_keysarray
2fa_webauthn_register_noncearray
svn_password_requiredboolean
svn_password_createdboolean, string

Authentication

  • Requires authentication; returns current user or allows updating own profile with edit_user.

Example Requests

bash
curl -X GET "https://wordpress.org/news/wp-json/wp/v2/users/me"
bash
curl -X POST "https://wordpress.org/news/wp-json/wp/v2/users/me" 
  -H 'Authorization: Basic <app-password>' 
  -H 'Content-Type: application/json' 
  -d '{"title":"Example"}'

Example Response (trimmed)

json
{
  "id": 1,
  "_links": {
    "self": [{ "href": "/wp/v2/users/me/1" }]
  }
}