Skip to main content
PATCH
/
api
/
admin
/
users
/
:id
curl -X PATCH "https://panel.example.com/api/admin/users/user-uuid" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "email": "[email protected]"
  }'
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "username": "john.doe",
    "email": "[email protected]",
    "name": "John Doe",
    "role": "admin",
    "createdAt": "2024-01-15T10:30:00Z"
  }
}

Authentication

This endpoint requires admin authentication and the users:write permission.

Path Parameters

id
string
required
User UUID

Request Body

username
string
Username (1-255 characters, trimmed)
email
string
Email address (trimmed, must be valid email)
password
string
New password (minimum 8 characters)
name
string
Full name (max 511 characters, trimmed). Will be split into first and last name.
nameFirst
string
First name (max 255 characters, trimmed)
nameLast
string
Last name (max 255 characters, trimmed)
language
string
Language code (max 10 characters, trimmed)
rootAdmin
boolean
Whether user has root admin privileges
role
string
User role: admin or user

Response

data
object
Updated user information
curl -X PATCH "https://panel.example.com/api/admin/users/user-uuid" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "email": "[email protected]"
  }'
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "username": "john.doe",
    "email": "[email protected]",
    "name": "John Doe",
    "role": "admin",
    "createdAt": "2024-01-15T10:30:00Z"
  }
}

Special Behaviors

Email Change

  • Email verification status is reset to null when email is changed
  • User will need to verify their new email address

Password Change

  • Password is hashed and stored securely
  • passwordResetRequired flag is automatically set to false
  • User can immediately log in with the new password

Name Handling

  • If name is provided without nameFirst/nameLast, it’s automatically split
  • First word becomes nameFirst, remaining words become nameLast
  • You can also provide nameFirst and nameLast directly for more control

Role Change

  • Role changes are applied through the auth system
  • Both role and rootAdmin fields are updated in the database

Notes

  • Only provided fields are updated
  • All updates set the updatedAt timestamp
  • Maximum request body size is 16 KB (SMALL size limit)

Build docs developers (and LLMs) love