Admin
The Admin API provides endpoints for user authentication, session management, user creation, API key management, and audit logging.
Features
JWT-based login with refresh token rotation
Create and manage system users with roles
Generate and manage API keys for integrations
Track all system actions and changes
Endpoints
POST /api/v1/admin/login
Authenticate and receive JWT tokens
POST /api/v1/admin/refresh
Refresh expired access token
POST /api/v1/admin/logout
Revoke refresh token
GET /api/v1/admin/me
Get authenticated user details
POST /api/v1/admin/users
Create new system user
POST /api/v1/admin/api-keys
Generate API keys
GET /api/v1/audit/logs
Query system audit logs
User Roles
| Role | Access Level |
|---|---|
system_admin | Full system access |
compliance_user | Compliance monitoring |
support_user | Customer support |
sales_user | Sales operations |
audit_user | Read-only audit access |
super_agent | Agent network management |
sub_agent | Field agent operations |
processor | POS merchant dashboard |
Authentication Flow
Call /admin/login with credentials to receive access token (15 min) and refresh token (7 days)
Include access token in Authorization: Bearer <token> header for all requests
When access token expires, call /admin/refresh with refresh token
Call /admin/logout to revoke refresh token