/tokens
0.1.0Unchanged since publicationCreate an API token for the caller
allThis operation requires the all scope. Supply scopes as an array or a comma-separated string. The default is read. Accepted scopes are read, domains, dns, certificates, mail, databases, files, users, backups, settings, security, export, license, and all. An empty scope list or an unknown scope returns 400.
The read scope covers every GET request except export downloads. The export scope covers export and import. The all scope can also be written as * and covers every scope except export. A login session with all therefore cannot grant export. Use urbestack-token-create at the shell to create a token with export. The API returns 403 if the calling token cannot grant one or more requested scopes.
The label defaults to api and accepts up to 64 characters. Set expires_in to a lifetime in whole seconds. The default is 0, which gives the token an unlimited lifetime. Set address to bind the token to a client IPv4 or IPv6 address. UrbeStack rejects and revokes the token if it is presented from a different IP address.
The 201 response contains the token secret, which is shown only once.
As a command
Run as root on the serveraddressstring, up to 45 charactersexpires_ininteger, 0 to 315360000labelstring, up to 64 charactersscopesarray of ScopeExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/tokens" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"address": "info@example.com",
"expires_in": 1,
"label": "my laptop",
"scopes": [
"read"
]
}'201 Created{
"address": "info@example.com",
"expires_at": "2026-09-16T10:15:00Z",
"id": 1,
"kind": "profile",
"label": "my laptop",
"scopes": [
"read"
],
"token": "ub_9f3c2a7e1b5d4082a6c1e7f0",
"user": "alice"
}Errors
20 errors, each a status and a sentence400A <kind> token needs the client's address400A plugin's token names its scopes400A session is opened by a panel user: name one with --actor400A session opened for a user is a session400At least one scope is required400Invalid <what>: expected a non-negative integer400Invalid IPv4 address400Invalid IPv6 address400Invalid id400Invalid label: 1 to 64 printable ASCII characters400Invalid user agent: 1 to 255 printable ASCII characters400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Unknown scope '<s>'; the scopes are 400Username '<value>' is reserved401Authentication required403<opener.name> may not open the panel of <owner>403Only a customer's panel is opened: <owner> is an administrator403User '<owner>' is suspended403your token cannot grant the scope <lacks>404User 'urbestack.com/docs/api/post-tokens/