Skip to main content

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.

The Identity API exposes a single endpoint — GET /api/me — that returns everything the frontend needs to make conditional rendering decisions: the user’s effective role, every granted permission key, the list of data modules the agent may query on their behalf, labor-cost restrictions, and the set of tenant instances they can access.
Client-side gating based on this response is for UX only. Every action is independently enforced server-side. Never use GET /api/me as a security gate in client code.

Authentication

Authorization: Bearer <id_token>
A valid Cognito-issued JWT is required. The role and permissions are resolved from the user’s Cognito group membership at request time.

GET /api/me

Returns the calling user’s resolved Principal as a public dictionary. The same shape is embedded in every agent graph state object, so the agent nodes always operate with an up-to-date copy of the caller’s access.

Response — MeResponse

user_id
string
required
Cognito subject (sub) — the stable UUID that uniquely identifies the user across all systems. Use this as the canonical user key in DynamoDB records.
username
string
required
Display username. In most deployments this is the user’s email address.
email
string
required
User’s email address.
tenant
string
required
Tenant identifier assigned to this user (custom:tenantId). Determines which deployment instance the user’s data queries are routed to. Defaults to "default" if unset.
role
string
required
The user’s effective role name, resolved from their Cognito group membership.
ValueDescription
platform_adminVendor staff — cross-tenant operations, full access to all instances.
org_adminOrganization administrator — manages users and roles within their tenant.
finance_leadFinance lead analyst — full read access plus data export.
analystStandard analyst — chat queries, visualisations, SQL view.
viewerRead-only — chat queries only, no SQL or export access.
permissions
array
required
Sorted list of atomic permission keys granted to this user. The full set of possible values is listed below.
modules
array
required
Sorted list of data module slugs the agent is allowed to query for this user. The effective set is computed as (role_base ∪ modules_added) − modules_removed from DynamoDB overrides.
labor_cost_restricted
boolean
required
true when the user has the costos module but not the nomina add-on. When true, the schema linker and SQL validator hide all Costos Mano de Obra account lines from generated queries and responses.
admin_panel
boolean
required
true only on the primary instance (where expected_tenant == "*"). The frontend uses this flag to show or hide the admin panel navigation link. The admin plane does not exist on tenant-specific deployments — see dev-log/037.
allowed_tenants
array
required
Additional instance slugs the user is authorised to access beyond their home tenant (custom:tenants). A platform_admin can access all instances regardless of this list.

Example

curl -X GET https://api.example.com/api/me \
  -H "Authorization: Bearer <id_token>"

GET /api/admin/roles

Returns the full role catalog, including pre-designed inactive roles. Requires admin.users.read permission.

Response — RoleCatalogResponse

roles
array
required
List of role definitions, sorted by rank descending (highest authority first).
all_permissions
array
required
Sorted list of every permission key defined in the system, regardless of role assignment.
all_modules
array
required
Sorted list of every module slug defined in the system.
curl -X GET https://api.example.com/api/admin/roles \
  -H "Authorization: Bearer <id_token>"

Error Reference

StatusCondition
401 UnauthorizedMissing or expired JWT.
403 ForbiddenValid JWT but insufficient permissions (e.g. calling /api/admin/roles without admin.users.read).
429 Too Many RequestsRate limit exceeded.

Build docs developers (and LLMs) love