/auth/login
0.1.0Unchanged since publicationExchange a name and password for a session token or a second-factor challenge
noneWith no second factor enrolled, the response contains token, expires_at, and user. Session tokens carry all scopes except export. If security.require_second_factor_admins requires the administrator to enroll, the response also sets enrol_second_factor to true and the token has no scopes. It can access routes that require no scope, including enrollment.
With a second factor enrolled, the response sets second_factor to true and contains challenge, expires_at, and user with only name. Submit the challenge to POST /auth/login/second-factor within two minutes from the same client IP address. A session token is bound to the client IP address that opened the session. UrbeStack rejects and revokes the token if it is presented from another IP address. UrbeStack records up to 255 characters from User-Agent for the session list when the client sends it.
Malformed credentials, an unknown name, a wrong password, a suspended account, and a client IP address blocked by the login policy all return 401 with the message "Invalid credentials". UrbeStack checks the login policy before verifying the password. A request that passes those checks but lacks a client IP address returns 500.
After verifying the credentials, UrbeStack checks whether the license allows sign-ins. It may refresh a stale result and retries a previous license refusal. If sign-ins are blocked, the response is 402 with the reason and, when available, this server's IP address as seen by the license server. If the license server has never answered, the grace period is seven days from installation.
For a customer whose system password is missing, UrbeStack uses the verified password to set it for SFTP and shell access. UrbeStack also uses the verified password to upgrade an imported SHA-512 crypt hash. A successful hash upgrade revokes the account's existing tokens. Sign-in can continue if either update fails.
As commands
Run as root on the servernameUsernameRequiredpasswordstring, up to 128 charactersRequiredExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/auth/login" \
-H "Content-Type: application/json" \
-d '{
"name": "alice",
"password": "Sup3r-Secret-Passphrase"
}'200 OK{
"challenge": "text",
"enrol_second_factor": true,
"expires_at": "2026-09-16T10:15:00Z",
"second_factor": true,
"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
47 errors, each a status and a sentence400--name is required400<name> has an owner: move them to the administrator before changing their role400<name> is an administrator: administrators have no home, so nothing to back up400<name> is an administrator: administrators have no system account400<name> is an administrator: administrators have no system account, so no shell400A <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 session400Cannot demote or suspend the last active administrator400Domain name required400Domain name too long400Invalid <what>: expected a non-negative integer400Invalid IPv4 address400Invalid IPv6 address400Invalid boolean400Invalid domain name400Invalid email address400Invalid id400Invalid label: 1 to 64 printable ASCII characters400Invalid password hash400Invalid password: 8 to 128 printable characters400Invalid port400Invalid role: admin, user or reseller400Invalid setting key400Invalid status400Invalid system password hash400Invalid user agent: 1 to 255 printable ASCII characters400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400Nothing to change400Only a customer has an owner: an administrator or a reseller is the administrator's own400The second factor can only be turned off here; a user enrols from their own page400Username '<value>' is reserved401Invalid credentials401The password is not the panel password402<s.reason><seen>403<opener.name> may not open the panel of <owner>403Only a customer's panel is opened: <owner> is an administrator403User '<owner>' is suspended404Setting '<key>' not found404User '404User '<name>' not found409<name> is on the package <p.name> of the reseller <p.owner>: change the package before the move409<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> urbestack.com/docs/api/post-auth-login/