The Admin API provides full lifecycle management for users in the shared Cognito user pool: creating and deleting accounts, assigning Cognito groups, controlling per-user data module access, and assigning tenant instance access. All endpoints are gated behind two independent checks.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/yohangr3/agentelanggrafh/llms.txt
Use this file to discover all available pages before exploring further.
Authentication
User Management
GET /api/admin/users
List all users in the Cognito user pool. Supports pagination and server-side filtering.Query Parameters
Maximum number of users to return per page (Cognito maximum is 60).
Opaque token returned in a previous response to fetch the next page.
Cognito filter expression, e.g.
email = "user@example.com".Response — AdminUserListResponse
Array of user summary objects.
Present when more users exist beyond this page. Pass as the
pagination_token query parameter in the next request.Number of users in this response page.
POST /api/admin/users
Create a new Cognito user. Returns the fullAdminUserDetail on success with HTTP 201 Created.
Rate limited to 10 requests per minute. The temporary password must be shared with the user through a secure out-of-band channel.
Request Body — CreateUserRequest
The user’s email address. Must be a valid email format. Also used as the Cognito username. Returns
409 Conflict if the email is already registered.Initial password (8–128 characters). The user will be forced to change it on first login. Returns
400 if it doesn’t meet Cognito’s password policy.Display name for the user.
Company or organisation name stored as
custom:company.Tenant identifier stored as
custom:tenantId.Response — AdminUserDetail
Extends AdminUserSummary with usage statistics:
List of Cognito group names the user belongs to.
Total conversation sessions in DynamoDB.
Total messages sent across all sessions.
Total SQL queries executed.
ISO-8601 timestamp of the most recent session activity.
GET /api/admin/users/{username}
Retrieve full details for a single user, including Cognito groups and aggregated DynamoDB usage statistics.Path Parameters
The Cognito username (typically the user’s email address).
Response
ReturnsAdminUserDetail (same shape as POST /api/admin/users response above).
PUT /api/admin/users/{username}
Update one or more Cognito attributes for an existing user. Omitted fields are left unchanged.Path Parameters
The Cognito username to update.
Request Body — UpdateUserRequest
New display name (
name attribute).Updated company name (
custom:company).Updated tenant identifier (
custom:tenantId). The user must re-authenticate for the change to take effect.Row-level filter: comma-separated centro de beneficio codes, e.g.
"1000,2000". Pass an empty string "" to remove all restrictions.Response — AdminActionResponse
true on success.Human-readable confirmation message.
DELETE /api/admin/users/{username}
Permanently delete a Cognito user. This action cannot be undone. All Cognito records are removed; DynamoDB conversation history is not deleted by this endpoint.Path Parameters
The Cognito username to delete.
POST /api/admin/users/{username}/reset-password
Trigger a Cognito-initiated password reset. Cognito sends a reset code to the user’s email. Rate limited to 5 requests per minute.POST /api/admin/users/{username}/disable
Disable a user account without deleting it. The user cannot log in while disabled but all records are preserved. Rate limited to 10 requests per minute.POST /api/admin/users/{username}/enable
Re-enable a previously disabled user account. Rate limited to 10 requests per minute.Group & Role Management
GET /api/admin/groups
List all Cognito groups in the shared user pool. Groups map to RBAC roles.Response — GroupListResponse
POST /api/admin/users/{username}/groups
Add a user to a Cognito group. The new role permissions take effect on the user’s next token issuance.Path Parameters
Cognito username.
Request Body — UserGroupRequest
Name of the Cognito group to add the user to.
DELETE /api/admin/users/{username}/groups/{group_name}
Remove a user from a Cognito group.Path Parameters
Cognito username.
Name of the Cognito group to remove the user from.
Module Assignment
Module overrides let administrators grant or revoke individual data modules beyond what a user’s base role provides. Overrides are persisted to DynamoDB and applied on every request without requiring a token refresh.Both module endpoints require the
admin.rbac.assign permission in addition to the admin Cognito group membership. Callers without this permission receive 403 Forbidden.GET /api/admin/users/{user_id}/modules
Return the effective module set for a user: their role’s base modules, plus any DynamoDB overrides (additions and removals).Path Parameters
The Cognito
sub (UUID) or username of the target user.Response — UserModulesResponse
Cognito subject UUID of the target user.
Tenant the user belongs to.
Effective role name (e.g.
analyst).Modules granted by the user’s role before overrides.
Modules explicitly granted via DynamoDB override.
Modules explicitly revoked via DynamoDB override.
Final computed module set:
(base ∪ added) − removed.PUT /api/admin/users/{user_id}/modules
Set per-user module overrides. Completely replaces any previous override for the user. Pass empty arrays to clear all overrides.Valid module slugs:
ingresos, costos, nomina, presupuestos, pagos, produccion, compras, inventario, logistica. An unknown slug returns 400 Bad Request with a list of valid values.Path Parameters
Cognito
sub UUID or username of the target user.Request Body — SetUserModulesRequest
Module slugs to grant beyond the role’s default set. Defaults to
[].Module slugs to revoke from the role’s default set. Defaults to
[].Instance Access
PUT /api/admin/users/{username}/instances
Assign the set of tenant instances a user is allowed to access, writing to thecustom:tenants Cognito attribute. The user must sign out and back in for the change to take effect — access is read from the JWT.
Path Parameters
Cognito username of the target user.
Request Body — SetUserInstancesRequest
List of registered instance slugs to assign. Pass an empty array to revoke all cross-instance access.
Cost Tracking
GET /api/admin/costs
Return a summary of LLM token costs aggregated globally, by user, and by agent node. Useful for monitoring spend and identifying heavy users.Cost data is aggregated from the backend cost tracking store. The exact shape of
global, by_user, and by_node sub-objects depends on the cost tracking configuration.Error Reference
| Status | Condition |
|---|---|
400 Bad Request | Invalid request body, unknown module/group name, or no update attributes provided. |
403 Forbidden | Caller is authenticated but not in the admin Cognito group, or lacks admin.rbac.assign. |
404 Not Found | Called on a non-primary tenant instance, or the target user/group was not found. |
409 Conflict | A user with the given email already exists in Cognito. |
429 Too Many Requests | Per-endpoint rate limit exceeded. |
502 Bad Gateway | Unexpected error from Cognito or DynamoDB. |