Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ShohjahonSohibov/repo-for-agent/llms.txt

Use this file to discover all available pages before exploring further.

UpdaterAgent uses role-based access control (RBAC) to authorize every API request. Each user is assigned a role; each role holds a set of granular permission keys. On login, the user’s permissions are embedded in the JWT as a flattened list of strings, so authorization checks are fast and require no additional database lookups. This page documents the endpoints for reading permissions, managing roles, and querying the audit log.

How permissions appear in the JWT

After a successful login, the JWT payload includes a permissions claim containing a JSON-serialized array of permission key strings:
{
  "sub": "123",
  "email": "user@example.com",
  "tenantId": "1",
  "sessionId": "456",
  "permissions": ["Loads.View", "Loads.Create", "Drivers.View"],
  "iat": 1234567890,
  "exp": 1234571490
}
Each protected endpoint declares the permission it requires. If the token’s permissions array does not contain that key, the API returns 403 Forbidden.
{
  "error": {
    "code": "Auth.Forbidden",
    "message": "You do not have permission to perform this action"
  }
}

Permissions endpoints

GET /api/permissions

List all permissions in the system. Requires the Permissions.View permission. Response
id
number
required
Numeric enum value identifying the permission.
key
string
required
The permission key string embedded in JWTs (e.g., "Loads.View").
description
string
Human-readable description of what this permission grants.
cURL
curl https://your-domain.com/api/permissions \
  -H "Authorization: Bearer <accessToken>"

GET /api/permissions/groups

Return all permissions organized by category. Useful for building role management UIs. Requires the Permissions.View permission. Response
groupName
string
required
Category name (e.g., "Load Management").
permissions
object[]
required
Array of permission objects belonging to this group.
cURL
curl https://your-domain.com/api/permissions/groups \
  -H "Authorization: Bearer <accessToken>"

Permission groups

The system contains 100+ individual permissions organized into the following categories. All permission keys follow the Resource.Action naming convention.
Permission keyDescription
Loads.ViewView loads and their details
Loads.CreateCreate new loads
Loads.UpdateUpdate load details, assign drivers, change status
Loads.DeleteDelete loads and their files
Loads.ExportExport load data
Permission keyDescription
Drivers.ViewView driver roster and details
Drivers.CreateAdd new drivers
Drivers.UpdateEdit driver details, manage sleep timers
Drivers.DeleteRemove drivers
Permission keyDescription
Users.ViewList and view user accounts
Users.CreateCreate new user accounts
Users.UpdateEdit users, activate, deactivate, reset passwords
Users.DeleteDelete user accounts
Roles.ViewView roles and their permissions
Roles.CreateCreate new roles
Roles.UpdateEdit roles and assign permissions
Roles.DeleteDelete roles
Permissions.ViewList all permissions
AuditLogs.ViewRead the system audit trail
Permission keyDescription
Trucks.ViewView truck fleet
Trucks.CreateAdd trucks
Trucks.UpdateEdit truck details
Trucks.DeleteRemove trucks
Trailers.ViewView trailer fleet
Trailers.CreateAdd trailers
Trailers.UpdateEdit trailer details
Trailers.DeleteRemove trailers
The system includes 100+ permissions across many other resource categories including Brokers, Tenants, Companies, Stops, Tickets, Settings, Reports, Notifications, Email, and Integrations. Use GET /api/permissions/groups to retrieve the complete categorized list.

Roles endpoints

GET /api/roles

List all roles defined within the current tenant. Requires the Roles.View permission. Response
id
number
required
Role ID.
name
string
required
Role display name.
permissions
string[]
Array of permission key strings assigned to this role.
cURL
curl https://your-domain.com/api/roles \
  -H "Authorization: Bearer <accessToken>"

POST /api/roles

Create a new role for the current tenant. Requires the Roles.Create permission. Request body
name
string
required
A unique display name for the role within the tenant.
cURL
curl -X POST https://your-domain.com/api/roles \
  -H "Authorization: Bearer <accessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name": "Dispatcher Supervisor"}'

POST /api/roles//permissions

Assign a set of permissions to a role, replacing any previously assigned permissions. Requires the Roles.Update permission. Path parameters
id
number
required
The ID of the role to update.
Request body
permissionIds
number[]
required
Array of numeric permission IDs to assign to the role. Retrieve valid IDs from GET /api/permissions.
cURL
curl -X POST https://your-domain.com/api/roles/7/permissions \
  -H "Authorization: Bearer <accessToken>" \
  -H "Content-Type: application/json" \
  -d '{"permissionIds": [1, 2, 3, 10, 11]}'

Built-in roles

UpdaterAgent ships with the following default roles. They can be used as-is or serve as a reference when creating custom roles.
RoleAccess level
System AdminAll permissions across the entire system
DispatcherLoad, driver, and truck management
ViewerRead-only access to loads, drivers, and related data
Custom rolesTenant-defined sets of any permissions from the full permission list
Roles are scoped per tenant. A role created in one tenant is not visible or applicable in another.

Audit logs

GET /api/audit-logs

Retrieve the system audit trail showing who did what and when. Requires the AuditLogs.View permission. Supports standard pagination via page and pageSize query parameters. Response
id
number
required
Unique audit log entry ID.
userId
number
required
ID of the user who performed the action.
action
string
required
Description of the action performed.
entityType
string
The type of resource that was affected (e.g., "Load", "Driver").
entityId
number
ID of the affected resource.
createdAt
string
required
ISO 8601 timestamp when the action occurred.
cURL
curl "https://your-domain.com/api/audit-logs?page=1&pageSize=20" \
  -H "Authorization: Bearer <accessToken>"

Build docs developers (and LLMs) love