/users/{name}/sessions
0.2.0Unchanged since publicationOpen a session as a customer
usersallAdministrators can open a session for any customer, and resellers can open one for their own customers. Use a token with the users scope. The customer's password and second factor are unnecessary. The web interface uses this operation to open the customer's panel in a separate tab as the customer sees it.
The session lasts up to one hour and ends when the token used to open it is revoked. If you used a session token, signing out of that session also ends the customer's session. It is bound to the caller's IP address. Presenting the token from another IP address rejects the request and revokes the token. The customer's session list includes opened_by. The audit log records each request made with the session with the caller as the actor and the customer's name in the as field.
The response contains token, expires_at, opened_by and the customer's account details in user. The API returns 400 if you target your own account or use a session opened by this operation. It returns 403 for an administrator target or insufficient management permissions, 409 for an inactive target account and 500 if the request lacks a client IP address.
As a command
Run as root on the serverExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/users/{name}/sessions" \
-H "Authorization: Bearer $TOKEN"201 Created{
"expires_at": "2026-09-16T10:15:00Z",
"opened_by": "text",
"token": "ub_9f3c2a7e1b5d4082a6c1e7f0",
"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
22 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 by someone else opens no further session400A session opened for a user is a session400Invalid <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 letter400Username '<value>' is reserved400Your own panel is the one you are in401Authentication required403<opener.name> may not open the panel of <owner>403Insufficient privileges403Only a customer's panel is opened: <name> is an administrator403Only a customer's panel is opened: <owner> is an administrator403User '<owner>' is suspended404User '409<name> is suspended: bring them back firsturbestack.com/docs/api/post-users-name-sessions/