The Users API covers the full lifecycle of a Termix user: registration, login (password and OIDC), two-factor authentication via TOTP, session and API key management, and admin operations such as promoting users and deleting accounts. Most endpoints require a valid JWT cookie orDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Termix-SSH/Termix/llms.txt
Use this file to discover all available pages before exploring further.
Authorization: Bearer header; endpoints marked admin only additionally require isAdmin: true on the authenticated user.
All authenticated endpoints read the session from a
jwt HttpOnly cookie set at login. You can also pass the token as Authorization: Bearer <token>.Registration & login
POST /users/create
Create a new user account. The first user to register is automatically granted admin privileges. Registration can be disabled by an admin.Unique username for the new account.
Plain-text password. Hashed with bcrypt before storage.
Confirmation string, e.g.
"User created".true when the newly created user was automatically promoted to admin (first user).UI hint object with
type and message fields.| Status | Meaning |
|---|---|
200 | User created successfully. |
400 | username or password is missing or empty. |
403 | Registration is currently disabled. |
409 | Username already exists. |
500 | Internal error during account creation. |
POST /users/login
Authenticate with a username and password. Sets ajwt HttpOnly cookie on success. If the account has TOTP enabled and the device is not trusted, a temporary token is returned instead and the client must complete TOTP verification.
The account username.
The account password.
When
true, extends the session cookie to 30 days instead of the configured timeout.true on successful authentication.Whether the authenticated user has admin privileges.
The authenticated username.
Present and
true when TOTP verification is required before full login.Short-lived JWT (10 minutes) used to complete TOTP verification. Only present when
requires_totp is true.| Status | Meaning |
|---|---|
200 | Login successful (or TOTP step required). |
400 | Missing or empty username / password. |
401 | Invalid credentials. |
403 | Password authentication is disabled, or user is OIDC-only. |
429 | Too many failed attempts — rate limited. |
500 | Internal login error. |
POST /users/logout
Invalidate the current session and clear thejwt cookie.
| Status | Meaning |
|---|---|
200 | Logged out successfully. |
500 | Logout failed. |
Current user
GET /users/me
Return profile information about the currently authenticated user.Unique user ID.
Display name.
Admin status.
Whether the account uses OIDC authentication.
Whether the account has both a password and OIDC configured.
Whether two-factor authentication is active.
Whether encrypted user data is currently decrypted in memory.
| Status | Meaning |
|---|---|
200 | User info returned. |
401 | Invalid or missing session. |
500 | Internal error. |
GET /users/setup-required
Check whether the instance needs initial setup (no users exist yet). No authentication required.true when the user table is empty.GET /users/count
Return the total number of registered users. Requires admin.Total user count.
| Status | Meaning |
|---|---|
200 | Count returned. |
403 | Admin access required. |
GET /users/db-health
Verify the database is reachable. Requires admin."ok" when the database is accessible.GET /users/data-status
Check whether encrypted user data is currently unlocked in memory.true when the data key is held in memory.Human-readable status description.
POST /users/unlock-data
Re-authenticate with a password to decrypt the user’s encrypted data in memory without creating a new session.The user’s current password.
true when data was unlocked.| Status | Meaning |
|---|---|
200 | Data unlocked. |
400 | Password is missing. |
401 | Incorrect password. |
500 | Internal error. |
Password management
POST /users/change-password
Change the current user’s password. Re-encrypts all user data with the new password and invalidates all existing sessions.The current password used for verification.
The desired new password.
| Status | Meaning |
|---|---|
200 | Password changed; all sessions invalidated. |
400 | oldPassword or newPassword is missing. |
401 | Incorrect current password. |
500 | Re-encryption of data failed. |
POST /users/initiate-reset
Start the password reset flow for a username. Generates a 6-digit code written to server logs (check Docker logs). The code expires after 15 minutes. No authentication required.Username of the account to reset.
| Status | Meaning |
|---|---|
200 | Reset code generated (or non-committal response for security). |
400 | Username is missing. |
403 | Password reset is disabled. |
POST /users/verify-reset-code
Verify the reset code received from server logs. Returns a short-livedtempToken (10 minutes) to be used in the final step.
Username of the account being reset.
6-digit code from server logs.
Short-lived token used to complete the reset.
| Status | Meaning |
|---|---|
200 | Code verified. |
400 | Invalid, expired, or missing code. |
429 | Rate limited. |
POST /users/complete-reset
Complete the password reset using thetempToken from the previous step.
Username of the account being reset.
Token returned by
POST /users/verify-reset-code.The new password to set.
| Status | Meaning |
|---|---|
200 | Password reset successfully. |
400 | Missing fields or expired token. |
404 | User not found. |
500 | Re-encryption failed. |
GET /users/registration-allowed
Check whether open registration is currently enabled. No authentication required.true when new users can register.PATCH /users/registration-allowed
Enable or disable user registration. Requires admin.true to allow registration; false to block it.| Status | Meaning |
|---|---|
200 | Setting updated. |
400 | allowed is not a boolean. |
403 | Admin only. |
GET /users/password-login-allowed
Check whether password-based login is enabled. No authentication required.PATCH /users/password-login-allowed
Enable or disable password-based login. Requires admin.| Status | Meaning |
|---|---|
200 | Setting updated. |
400 | allowed is not a boolean. |
403 | Admin only. |
GET /users/password-reset-allowed
Check whether the self-service password reset flow is enabled. No authentication required.PATCH /users/password-reset-allowed
Enable or disable the self-service password reset flow. Requires admin.| Status | Meaning |
|---|---|
200 | Setting updated. |
400 | allowed is not a boolean. |
403 | Admin only. |
OIDC
GET /users/oidc-config
Return the public OIDC configuration (client ID, issuer URL, authorization URL, and scopes). No authentication required. Returnsnull when OIDC is not configured.
OAuth2 client identifier.
OIDC provider issuer URL.
Authorization endpoint URL.
Space-separated OAuth2 scopes.
GET /users/oidc-config/admin
Return the full OIDC configuration including the client secret. Requires admin.Decrypted client secret.
POST /users/oidc-config
Create or update the OIDC provider configuration. Pass all fields empty/null/undefined to disable OIDC. Requires admin.OAuth2 client ID from your identity provider.
OAuth2 client secret. Stored encrypted.
OIDC issuer URL (e.g.
https://accounts.example.com).Authorization endpoint.
Token exchange endpoint.
Optional userinfo endpoint override.
Dot-notation path to the unique identifier claim (e.g.
sub).Dot-notation path to the display name claim (e.g.
name).Space-separated scopes. Defaults to
openid email profile.Comma-separated list of allowed identifiers or email domains (e.g.
@example.com). Leave empty to allow all.| Status | Meaning |
|---|---|
200 | Configuration saved or disabled. |
400 | Incomplete configuration fields. |
403 | Admin only. |
DELETE /users/oidc-config
Disable OIDC authentication by removing the stored configuration. Requires admin.| Status | Meaning |
|---|---|
200 | OIDC configuration removed. |
403 | Admin only. |
GET /users/oidc/authorize
Generate an OIDC authorization URL to redirect the user to the identity provider. No authentication required.When
"true", the resulting session cookie will last 30 days.Full authorization URL to redirect the user to.
CSRF state parameter.
OIDC nonce value.
| Status | Meaning |
|---|---|
200 | Authorization URL returned. |
404 | OIDC not configured. |
500 | URL generation failed. |
GET /users/oidc/callback
OIDC callback endpoint. Exchanges the authorization code for a token, creates or logs in the user, and redirects the browser back to the frontend with ajwt cookie set. Not intended to be called directly — this is the redirect URI registered with your identity provider.
Authorization code from the identity provider.
State parameter returned by
GET /users/oidc/authorize.| Status | Meaning |
|---|---|
302 | Redirects to frontend with jwt cookie set, or with error param on failure. |
400 | Missing code or state, or invalid state / token exchange failure. |
Two-factor authentication (TOTP)
POST /users/totp/setup
Initiate TOTP setup. Generates a base32 secret and a QR code data URL. The user must scan the QR code in their authenticator app and then callPOST /users/totp/enable to activate it.
Base32-encoded TOTP secret.
Data URL of the QR code image to display to the user.
| Status | Meaning |
|---|---|
200 | Secret and QR code returned. |
400 | TOTP is already enabled. |
404 | User not found. |
POST /users/totp/enable
Enable TOTP by verifying the first code from the authenticator app. Returns 8 one-time backup codes. All existing sessions and trusted devices are invalidated.6-digit code from the authenticator app.
Confirmation message.
8 single-use backup codes. Store these securely.
| Status | Meaning |
|---|---|
200 | TOTP enabled; backup codes returned. |
400 | Code missing, or TOTP already enabled, or setup not initiated. |
401 | Invalid TOTP code. |
POST /users/totp/disable
Disable TOTP. Requires either the current password or a valid TOTP code for verification.Current account password (for non-OIDC users).
Current 6-digit TOTP code (alternative to
password).| Status | Meaning |
|---|---|
200 | TOTP disabled. |
400 | Neither password nor TOTP code provided, or TOTP not enabled. |
401 | Incorrect password or invalid code. |
POST /users/totp/backup-codes
Regenerate the TOTP backup codes. The previous codes are invalidated. Requires either password or TOTP code.Current account password.
Current TOTP code.
8 new one-time backup codes.
| Status | Meaning |
|---|---|
200 | New backup codes returned. |
400 | Authentication not provided, or TOTP not enabled. |
401 | Invalid credentials. |
POST /users/totp/verify-login
Complete a login that requires TOTP verification. Submit the temporary token issued byPOST /users/login along with the TOTP code. On success, sets the full session cookie.
Short-lived JWT returned by
POST /users/login when requires_totp is true.6-digit code from the authenticator app, or a backup code.
When
true, the device is marked as trusted and TOTP will be skipped for future logins from it.| Status | Meaning |
|---|---|
200 | Verified; full session cookie set. |
400 | Missing temp_token or totp_code. |
401 | Invalid temporary token or wrong TOTP code. |
429 | Rate limited. |
Sessions
GET /users/sessions
List sessions. Regular users see their own sessions; admins see all sessions with associated usernames.DELETE /users/sessions/:sessionId
Revoke a specific session by ID. Users can revoke their own sessions; admins can revoke any session.ID of the session to revoke.
| Status | Meaning |
|---|---|
200 | Session revoked. |
400 | sessionId not provided. |
403 | Not authorized to revoke this session. |
404 | Session not found. |
POST /users/sessions/revoke-all
Revoke all sessions for a user. Admins can target any user by passingtargetUserId.
User whose sessions should be revoked. Admins only; defaults to the calling user.
When
true, the caller’s current session is preserved.Number of sessions that were revoked.
| Status | Meaning |
|---|---|
200 | Sessions revoked. |
403 | Not authorized to revoke sessions for another user. |
404 | User not found. |
Admin user management
GET /users/list
Return a list of all users. Available to any authenticated user; the response is used by admin UIs.POST /users/make-admin
Grant admin privileges to a user. Requires admin.Target user ID (preferred).
Target username (fallback if
userId is not provided).| Status | Meaning |
|---|---|
200 | User promoted to admin. |
400 | userId / username missing, or user already an admin. |
403 | Admin only. |
404 | User not found. |
POST /users/remove-admin
Revoke admin privileges from a user. Requires admin. Cannot revoke your own admin status.Target user ID.
Target username (fallback).
| Status | Meaning |
|---|---|
200 | Admin status removed. |
400 | Cannot remove own admin status, or user is not an admin. |
403 | Admin only. |
404 | User not found. |
DELETE /users/delete-account
Delete the authenticated user’s own account. Requires password confirmation. OIDC-only accounts cannot use this endpoint.Current password for verification.
| Status | Meaning |
|---|---|
200 | Account deleted. |
400 | Password missing. |
401 | Incorrect password. |
403 | OIDC-only account, or cannot delete the last admin. |
404 | User not found. |
DELETE /users/delete-user
Admin-only endpoint to delete any user and all their associated data (hosts, credentials, sessions, etc.).Username of the account to delete.
| Status | Meaning |
|---|---|
200 | User deleted. |
400 | Username missing, or cannot delete yourself. |
403 | Admin only, or cannot delete the last admin. |
404 | User not found. |
POST /users/link-oidc-to-password
Merge an OIDC-only account into an existing password-based account, enabling dual authentication. The OIDC account is deleted after the merge. Requires admin.ID of the OIDC-only user to merge.
Username of the password-based account to receive OIDC authentication.
| Status | Meaning |
|---|---|
200 | Accounts linked; OIDC user deleted. |
400 | Invalid source/target combination. |
403 | Admin only. |
404 | User not found. |
POST /users/unlink-oidc-from-password
Remove OIDC authentication from a dual-auth account, leaving only password login. Requires admin. The user must have a password set; this call will fail if removing OIDC would leave the user with no login method.ID of the user to modify.
| Status | Meaning |
|---|---|
200 | OIDC removed. |
400 | User is not OIDC, or has no password set. |
403 | Admin only. |
404 | User not found. |
System settings
GET /users/guacamole-settings
Return Guacamole (RDP/VNC proxy) settings.Whether the Guacamole daemon is enabled.
host:port string for the guacd daemon (default guacd:4822).PATCH /users/guacamole-settings
Update Guacamole settings. Requires admin. Changing the URL triggers a guacd server restart.Enable or disable the Guacamole daemon.
New
host:port for guacd (e.g. guacd:4822).| Status | Meaning |
|---|---|
200 | Settings updated. |
403 | Admin only. |
GET /users/log-level
Return the current server log verbosity level.One of
debug, info, warn, error.PATCH /users/log-level
Set the server log verbosity. Requires admin.One of
debug, info, warn, error.| Status | Meaning |
|---|---|
200 | Level updated. |
400 | Invalid level value. |
403 | Admin only. |
GET /users/session-timeout
Return the configured session timeout in hours.Session expiry in hours (default
24).PATCH /users/session-timeout
Set the session timeout. Requires admin. Valid range: 1–720 hours.Session expiry in hours (1–720).
| Status | Meaning |
|---|---|
200 | Timeout updated. |
400 | Value out of range. |
403 | Admin only. |
API keys
API keys let you authenticate programmatically without a browser session. They are admin-managed: only admins can create or delete them. Each key is scoped to a specific user and acts on that user’s behalf. The full token value (tmx_...) is shown only once at creation time.
POST /users/api-keys
Create a new API key for a target user. Requires admin.Human-readable label for the key.
ID of the user this key acts on behalf of.
ISO 8601 datetime for key expiry. Omit for a non-expiring key.
Key ID.
Key name.
User this key is scoped to.
Username of the scoped user.
First 12 characters of the token (for identification).
Full API token — shown only once.
ISO 8601 creation timestamp.
ISO 8601 expiry timestamp, or
null.| Status | Meaning |
|---|---|
201 | Key created; token returned once. |
400 | Missing name / userId, or invalid expiresAt. |
403 | Admin only. |
404 | Target user not found. |
GET /users/api-keys
List all API keys. Requires admin. Token hashes are never returned.DELETE /users/api-keys/:keyId
Permanently delete an API key. Requires admin.The ID of the API key to delete.
| Status | Meaning |
|---|---|
200 | Key deleted. |
403 | Admin only. |
404 | Key not found. |