User Management
- GET /users
Get users list
Retrieve a list of users with optional filtering by username, email, first/last name
- Query Parameters:
username (string) – Filter by username
email (string) – Filter by email
firstname (string) – Filter by first name
lastname (string) – Filter by last name
- Status Codes:
200 OK – List of users
500 Internal Server Error – Internal server error
- POST /users/mark-registered
Register the deployment (first-run NAG)
Marks root-tenant users registered once, on first run. Pre-login; first-run-gated + root-scoped.
- Status Codes:
200 OK – Users marked as registered (or already registered)
404 Not Found – No users found
500 Internal Server Error – Internal server error
- POST /users/reset-token
Generate password reset OTP
Admin endpoint: generates a short-lived single-use OTP for the named user. Deliver it to the user via a secure out-of-band channel (phone, in-person). The OTP expires in 15 minutes.
- Status Codes:
200 OK – OTP generated
400 Bad Request – User is inactive
404 Not Found – User not found
500 Internal Server Error – Internal server error
- GET /users/tenants
List users by tenant
List all users assigned to a specific tenant with pagination
- Query Parameters:
tenant_id (string) – Tenant ID
page (integer) – Page number (default: 1)
page_size (integer) – Page size (default: 50)
- Status Codes:
200 OK – List of users with pagination
404 Not Found – Tenant not found
500 Internal Server Error – Internal server error
- POST /users/tenants/assign
Assign user to tenant
Assign a user to a tenant (CloudStack domain)
- Request JSON Object:
tenant_id (string) – (required)
user_id (integer) – (required)
- Status Codes:
200 OK – User assigned to tenant successfully
400 Bad Request – Invalid request
404 Not Found – User or tenant not found
500 Internal Server Error – Internal server error
- DELETE /users/{username}
Delete user
Delete a user account by setting is_active to false (soft delete)
- Parameters:
username (string) – Username
- Status Codes:
200 OK – User deleted successfully
404 Not Found – User not found
500 Internal Server Error – Internal server error
- PUT /users/{username}
Update user
Update user properties like active status, 2FA requirement, and approvers
- Parameters:
username (string) – Username
- Request JSON Object:
approvers (string)
is_2fa_required (boolean)
is_active (boolean)
requires_approval (boolean)
user_id (integer)
- Status Codes:
200 OK – User updated successfully
400 Bad Request – Invalid request payload
404 Not Found – User not found
500 Internal Server Error – Internal server error
- GET /users/{username}/approvers
Get available approvers
Retrieve list of available approvers for approval requests
- Parameters:
username (string) – Username
- Status Codes:
200 OK – List of available approvers
500 Internal Server Error – Internal server error
- GET /users/{username}/profile
Get user profile
Retrieve complete user information including creation timestamp, all assigned roles, and their permissions. The user is identified from the JWT token.
- Parameters:
username (string) – Username
- Status Codes:
200 OK – Complete user profile with roles and permissions
401 Unauthorized – Unauthorized - invalid or missing token
404 Not Found – User not found
500 Internal Server Error – Internal server error
- POST /users/{username}/roles
Assign roles to user
Assign or update roles for a specific user
- Parameters:
username (string) – Username
- Request JSON Object:
role_ids[] (integer)
- Status Codes:
200 OK – Roles assigned successfully
400 Bad Request – Invalid request payload
404 Not Found – User not found
500 Internal Server Error – Internal server error