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 of users per pageMinimum: 1
Maximum: 60 (Cognito limit)
Default: 60
Maximum: 60 (Cognito limit)
Default: 60
Pagination cursor from the previous responseOmit for first page.
Response
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
Cursor for the next page (null if no more results)
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
Email address for the new user (used as username, will be lowercased)Format: Valid emailExample:
[email protected]Temporary password (minimum 8 characters)Must meet Cognito password policy. The user must change this on first login.Min length: 8Example:
TempP@ss123!If true, Cognito sends a welcome email with login instructions to the new user
Response
The created user’s Cognito username
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
Cognito username (typically the email address or UUID sub)Example:
[email protected]Response
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
Cognito username to updateExample:
[email protected]Request Body
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
Cognito username to deleteExample:
[email protected]Response
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
Cognito username to enableExample:
[email protected]Response
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
Cognito username to disableExample:
[email protected]Response
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
Cognito username whose password to resetExample:
[email protected]Request Body
Temporary password (minimum 8 characters, must meet Cognito policy)Example:
TempP@ss123!Response
Example Request
Error Responses
Validation error (invalid email format, password too short, email already exists, etc.)
Missing or invalid Bearer token
Forbidden — admin role required
User not found
User Statuses
Cognito users can have the following statuses:| Status | Description |
|---|---|
CONFIRMED | User has confirmed their email and set a permanent password |
FORCE_CHANGE_PASSWORD | User must change their temporary password on next login |
UNCONFIRMED | User has not yet confirmed their email address |
ARCHIVED | User account has been deleted (soft delete) |
COMPROMISED | User credentials have been compromised |
UNKNOWN | Status cannot be determined |
Source Code
Implementation:packages/api/src/admin/users.controller.ts