Get your free beta license ↗
API operation · users group
PATCH

/users/{name}

First published 3 Oct 20260.1.0Unchanged since publication

Update a user account

Who may call it
AdministratorResellerCustomer
Token scope, any of
usersall
Answers200 OK

Any user can change their own email address and password. Administrators can manage any account. Resellers can change their customers' email addresses, passwords, status, packages, shell access and nightly backup settings. Changing role or owner requires an administrator. The API returns 403 for a change the caller lacks permission to make. It returns 400 if the request specifies no changes or if an administrator tries to change their own role, status, shell, backups or owner. An administrator can change their own package.

Changing your own password requires current_password. It revokes your other sessions and preserves the calling token and manually created tokens. Resetting another account's password or suspending an account revokes all of that account's tokens. A new password must contain 8 to 128 printable characters. For a customer, it also sets the password used for SFTP and shell access.

Pass an empty string in email to clear the email address or in package to remove the package and its limits. An invalid package name returns 400. Changing an administrator's email address or moving an account into or out of the administrator role updates delivery of root's mail.

Use active or suspended for status. Other values return 400. For a customer, suspension also disables their mailboxes in Dovecot and their domains' senders in Postfix. Reactivation restores both. Accounts suspended for a server move must be reactivated through the move workflow. For a copy awaiting cutover, use the Move section of the web interface or urbestack-move-cutover --user NAME. For a frozen account on the source server, use urbestack-move-source-release --user NAME. Add --take-back to the latter if the account has already moved.

For an account with a Linux account, set shell to true to enable Bash access and remove the SFTP jail. Set shell to false to restore jailed SFTP access and end running system sessions. For an account with a home directory, set backups to false to exclude it from nightly server backups. Set it to true to restore the default inclusion. Customers can still request backups.

Set owner to a reseller's name to transfer the customer, or pass an empty string to transfer the customer to the administrator. Change or clear a package belonging to the former reseller before or during the transfer. A transfer to a reseller must fit their customer count, disk and bandwidth limits. Increasing a customer's disk or bandwidth allowance must also fit their reseller's limits. To change a customer's role, first place the customer under the administrator. To change a reseller's role, first reassign all their customers.

The response contains the updated account in user. For customers and resellers, home gives the path configured through home_base and uid gives the Linux user ID, or null if the Linux account is missing. Both fields are null for administrators.

As a command

Run as root on the server

Parameters

namepath ·UsernameRequired

Request body

JSON ·UserPatch· 9 fields
backupsboolean
Whether the customer is included in the server's nightly backup run. Only administrators can change this setting.
current_passwordstring, up to 128 characters
Current password, required when users change their own password.
emailstring, up to 254 characters or null
New email address. Use null or an empty string to remove it.
ownerstring, up to 32 characters or null
New reseller for the customer, or an empty string for direct ownership by the administrator. Only administrators can move the customer, and UrbeStack refuses the move if the customer still uses a package belonging to the current owner or the move would exceed the new owner's limit.
packagestring, up to 64 characters or null
Package, which only administrators can change. Use null or an empty string to remove the assignment.
passwordstring, up to 128 characters
roleRole
Role, which only administrators can change.
shellboolean
Customer shell access, which only administrators can change. Turning it off ends the customer's active sessions, and either setting preserves the customer's files.
statusstring, one of active, suspended
Status, which only administrators can change. Suspending a customer disables their mailboxes and senders in the mail stack.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X PATCH "$API/users/alice" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "backups": true,
    "current_password": "text",
    "email": "alice@example.com",
    "owner": "text",
    "package": "basic",
    "password": "Sup3r-Secret-Passphrase",
    "role": "user",
    "shell": true,
    "status": "active"
  }'
Response · 200 OK
{
  "user": {
    "backups": true,
    "bandwidth_bytes": 1,
    "bandwidth_cut": true,
    "bandwidth_cut_at": "text",
    "bandwidth_limit_bytes": 1,
    "created_at": "2026-09-09T10:15:00Z",
    "customers": 1,
    "disk_limit_bytes": 1,
    "email": "alice@example.com",
    "home": "text",
    "id": 1,
    "move_state": "leaving",
    "name": "alice",
    "owner": "text",
    "owner_id": 1,
    "package": "basic",
    "package_backups": true,
    "package_id": 1,
    "package_shell": true,
    "role": "user",
    "second_factor": true,
    "shell": true,
    "status": "active",
    "system_password": true,
    "uid": 1
  }
}

Errors

40 errors, each a status and a sentence
400--name is required
400<name> has an owner: move them to the administrator before changing their role
400<name> is an administrator: administrators have no home, so nothing to back up
400<name> is an administrator: administrators have no system account
400<name> is an administrator: administrators have no system account, so no shell
400Cannot demote or suspend the last active administrator
400Domain name required
400Domain name too long
400Invalid IPv4 address
400Invalid IPv6 address
400Invalid boolean
400Invalid domain name
400Invalid email address
400Invalid id
400Invalid package name
400Invalid password hash
400Invalid password: 8 to 128 printable characters
400Invalid port
400Invalid role: admin, user or reseller
400Invalid setting key
400Invalid status
400Invalid system password hash
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Nothing to change
400Only a customer has an owner: an administrator or a reseller is the administrator's own
400The second factor can only be turned off here; a user enrols from their own page
400Username '<value>' is reserved
400You cannot change your own role, status, shell, backups or owner
400status must be active or suspended
401Authentication required
401The password is not the panel password
403Only an administrator changes a user's <k>
403Only an administrator or the customer's reseller changes a user's <k>
404Setting '<key>' not found
404User '<name>' not found
409<name> is on the package <p.name> of the reseller <p.owner>: change the package before the move
409<name> owns <owned>
409<who> and its bandwidth for the month is used up:
409<who> and its disk is used up:
409The package <p.name> allows <limit>
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/patch-users-name/