Authentication
All endpoints require JWT Bearer token (Cognito) with admin role.List Users
GET /api/admin/users
Returns a cursor-paginated list of all Cognito users.
Query Parameters
number
default:"60"
Number of users per pageMinimum: 1
Maximum: 60 (Cognito limit)
Default: 60
Maximum: 60 (Cognito limit)
Default: 60
string
Pagination cursor from the previous responseOmit for first page.
Response
object
array
Array of Cognito user objectsEach user has:
Username(string): Cognito username (typically email or UUID)Attributes(array): User attributes (email, name, etc.)UserStatus(string): Account status (CONFIRMED, FORCE_CHANGE_PASSWORD, etc.)Enabled(boolean): Whether the account is enabledUserCreateDate(string): ISO 8601 creation timestampUserLastModifiedDate(string): ISO 8601 last modified timestamp
string
Cursor for the next page (null if no more results)
number
Number of users in this page
Example Request
Example Response
Create User
POST /api/admin/users
Creates a new user in Cognito with a temporary password. The user must change their password on first login (NEW_PASSWORD_REQUIRED challenge).
Request Body
string
required
Email address for the new user (used as username, will be lowercased)Format: Valid emailExample:
newuser@example.comstring
required
Temporary password (minimum 8 characters)Must meet Cognito password policy. The user must change this on first login.Min length: 8Example:
TempP@ss123!boolean
default:"false"
If true, Cognito sends a welcome email with login instructions to the new user
Response
string
The created user’s Cognito username
string
Initial user statusTypically
FORCE_CHANGE_PASSWORD (user must change password on first login)Example Request
Example Response
Get User
GET /api/admin/users/:username
Returns full details for a specific Cognito user including attributes, status, groups, and account metadata.
Path Parameters
string
required
Cognito username (typically the email address or UUID sub)Example:
user@example.comResponse
Full Cognito user object with all attributes, groups, and metadata.Example Request
Update User
PUT /api/admin/users/:username
Updates one or more Cognito user attributes. Pass only the attributes you want to change.
Path Parameters
string
required
Cognito username to updateExample:
user@example.comRequest Body
object
Key-value map of Cognito user attributes to updateUse standard Cognito attribute names (e.g.
email, name, phone_number) or custom attributes (e.g. custom:role).Example:Response
Example Request
Delete User
DELETE /api/admin/users/:username
Permanently deletes a user from Cognito. This action is irreversible.
Path Parameters
string
required
Cognito username to deleteExample:
user@example.comResponse
Example Request
Enable User
POST /api/admin/users/:username/enable
Re-enables a previously disabled Cognito user, restoring their ability to sign in.
Path Parameters
string
required
Cognito username to enableExample:
user@example.comResponse
Example Request
Disable User
POST /api/admin/users/:username/disable
Disables a Cognito user, preventing them from signing in. Their account and data are preserved.
Path Parameters
string
required
Cognito username to disableExample:
user@example.comResponse
Example Request
Reset Password
POST /api/admin/users/:username/reset-password
Sets a new temporary password for the user. On next login, the user will be forced through the NEW_PASSWORD_REQUIRED challenge to set a permanent password.
Path Parameters
string
required
Cognito username whose password to resetExample:
user@example.comRequest Body
string
required
Temporary password (minimum 8 characters, must meet Cognito policy)Example:
TempP@ss123!Response
Example Request
Error Responses
error
Validation error (invalid email format, password too short, email already exists, etc.)
error
Missing or invalid Bearer token
error
Forbidden — admin role required
error
User not found
User Statuses
Cognito users can have the following statuses:Source Code
Implementation:packages/api/src/admin/users.controller.ts