# POST /users

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the users group.

Create a user account

- Who may call it: administrator, reseller
- Token scope, any of: users, all
- Answers: 201 Created

The default role is user, which creates a customer. An administrator can create any role and use owner to assign a customer to a reseller. For requests from an administrator, an omitted or empty owner creates an account owned directly by the administrator. A reseller creates customers under their own account and receives 403 if they request another role or specify a different owner.

Customers and resellers get a Linux account with shell access disabled, an FTP login and a phpMyAdmin account. Nightly backups include both roles. The password must contain 8 to 128 printable characters. The name must be unused in UrbeStack and, for a customer or reseller, on Linux.

Choose an administrator's package or, for a customer assigned to a reseller, one of that reseller's packages. The reseller must have room for another customer and stay within their package's combined disk and bandwidth limits across their customers. A package name is 1 to 64 characters. It starts with an ASCII letter or digit and may also contain spaces, periods, underscores and hyphens after the first character. An invalid package name returns 400.

Setting email for an administrator also updates delivery of root's mail. If the mail update fails, UrbeStack logs the error, keeps the account and retries the update on the next rebuild. The API still returns 201.

The response contains the created 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

- [urbestack-user-add](https://urbestack.com/docs/commands/urbestack-user-add.md): Creates an UrbeStack account.

## Request body

JSON, the type [UserCreate](https://urbestack.com/docs/api/types/UserCreate.md).

- `name` (Username, required): A username consists of lowercase letters, digits and underscores. For the user role, it also serves as the system account name.
- `password` (string, up to 128 characters, required)
- `email` (string, up to 254 characters)
- `owner` (Username): Username of the reseller who will own the customer. An administrator can choose the owner, and customers created by a reseller belong to that reseller.
- `package` (string, up to 64 characters)
- `role` (Role): An admin is an administrator who manages the server, and a user is a hosting customer. A reseller is a hosting customer who has administrator permissions limited to the customers they own.

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/users" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "alice@example.com",
    "name": "alice",
    "owner": "alice",
    "package": "basic",
    "password": "Sup3r-Secret-Passphrase",
    "role": "user"
  }'
```

Response, 201 Created:

```
{
  "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

- 400: An administrator has no shell: only a customer has a system account
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: Invalid boolean
- 400: Invalid domain name
- 400: Invalid email address
- 400: Invalid package name
- 400: Invalid password hash
- 400: Invalid password: 8 to 128 printable characters
- 400: Invalid port
- 400: Invalid role: admin, user or reseller
- 400: Invalid setting key
- 400: Invalid status
- 400: Invalid system password hash
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Only a customer has an owner: an administrator or a reseller is the administrator's own
- 400: Username '<value>' is reserved
- 401: Authentication required
- 403: A reseller makes customers of their own
- 403: A reseller makes customers of their own: role user
- 404: Setting '<key>' not found
- 409: <who> and its bandwidth for the month is used up: 
- 409: <who> and its disk is used up: 
- 409: A system account named '<name>' already exists
- 409: The package <p.name> allows <limit> 
- 409: User '<name>' already exists
