Admin API
Endpoints for managing users, teams, skills, and organization settings.
Organization Settings
Get Settings
/api/admin/settingsAuth: SessionGet organization settings (Admin only).
Response (200):
{ "organization": { "id": "uuid", "name": "Acme Corp", "slug": "acme-corp", "timezone": "America/New_York", "settings": { "serviceLevelTarget": 80, "serviceLevelThreshold": 20 } }}Update Settings
/api/admin/settingsAuth: SessionUpdate organization settings (Admin only).
Request Body:
{ "name": "Acme Corporation", "timezone": "America/Chicago", "settings": { "serviceLevelTarget": 85, "serviceLevelThreshold": 20 }}User Management
List Users
/api/admin/usersAuth: SessionList all users in the organization (Admin only).
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | Optional | Filter: "active", "inactive" |
role | string | Optional | Filter: "admin", "supervisor", "agent" |
teamId | string | Optional | Filter by team |
search | string | Optional | Search by name or email |
Response (200):
{ "users": [ { "id": "uuid", "email": "john@example.com", "firstName": "John", "lastName": "Doe", "role": "agent", "status": "active", "employee": { "id": "uuid", "employeeNumber": "EMP001", "teamName": "Sales" } } ]}Create User
/api/admin/usersAuth: SessionCreate a new user (Admin only).
Request Body:
{ "email": "jane@example.com", "firstName": "Jane", "lastName": "Smith", "role": "agent", "password": "optional-password", "employee": { "employeeNumber": "EMP002", "teamId": "uuid", "employmentType": "full_time", "weeklyHoursTarget": 40 }}Update User
/api/admin/users/:idAuth: SessionUpdate a user (Admin only).
Deactivate User
/api/admin/users/:idAuth: SessionDeactivate a user (soft delete, Admin only).
Team Management
List Teams
/api/admin/teamsAuth: SessionGet all teams.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
includeMembers | boolean | Optional | Include team member list |
Response (200):
{ "teams": [ { "id": "uuid", "name": "Sales Team", "supervisorId": "uuid", "supervisorName": "John Manager", "memberCount": 12 } ]}Create Team
/api/admin/teamsAuth: SessionCreate a new team (Admin only).
Request Body:
{ "name": "Support Team", "supervisorId": "uuid", "parentTeamId": null}Skill Management
List Skills
/api/admin/skillsAuth: SessionGet all skills.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | Optional | Filter by category |
Response (200):
{ "skills": [ { "id": "uuid", "name": "Billing", "description": "Handle billing inquiries", "category": "technical", "proficiencyLevels": ["beginner", "intermediate", "advanced", "expert"] } ]}Create Skill
/api/admin/skillsAuth: SessionCreate a skill (Admin only).
Request Body:
{ "name": "Technical Support", "description": "Handle technical issues", "category": "technical", "proficiencyLevels": ["beginner", "intermediate", "advanced", "expert"]}Assign Skill to Employee
/api/admin/skills/assignmentsAuth: SessionAssign a skill to an employee.
Request Body:
{ "employeeId": "uuid", "skillId": "uuid", "proficiencyLevel": "expert"}API Key Management
List API Keys
/api/admin/api-keysAuth: SessionList API keys (masked, Admin only).
Response (200):
{ "apiKeys": [ { "id": "uuid", "name": "ACD Integration", "keyPreview": "nwfm_...abc", "permissions": ["import:agent-states"], "status": "active", "lastUsedAt": "2026-01-29T10:00:00Z", "createdAt": "2026-01-01T00:00:00Z" } ]}Create API Key
/api/admin/api-keysAuth: SessionCreate an API key (Admin only).
Request Body:
{ "name": "ACD Integration", "permissions": ["import:agent-states", "import:historical"]}The full API key is only shown once in the response. Store it securely.
Response (201):
{ "success": true, "apiKey": { "id": "uuid", "name": "ACD Integration", "key": "nwfm_abc123xyz789..." }}Revoke API Key
/api/admin/api-keys/:idAuth: SessionRevoke an API key.
Request Body:
{ "action": "revoke"}Audit Logs
/api/admin/audit-logsAuth: SessionGet audit logs (Admin only).
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | number | Optional | Max results (default 50) |
offset | number | Optional | Pagination offset |
action | string | Optional | Filter by action type |
Response (200):
{ "logs": [ { "id": "uuid", "userId": "uuid", "userName": "John Admin", "action": "user.created", "details": { "email": "new@example.com" }, "ipAddress": "192.168.1.1", "createdAt": "2026-01-29T10:00:00Z" } ], "total": 1250}Onboarding
Get Onboarding Status
/api/admin/onboardingAuth: SessionCheck onboarding progress by verifying entity existence (teams, employees, templates, schedules).
Response (200):
{ "dismissed": false, "completed": false, "demoDataSeeded": false, "steps": { "orgSettings": true, "team": false, "employees": false, "shiftTemplate": false, "schedule": false }}Dismiss Onboarding
/api/admin/onboardingAuth: SessionDismiss the onboarding checklist for the organization.
Request Body:
{ "dismissed": true}Sample Data Seeding
Seed Demo Data
/api/admin/data/seed-demoAuth: SessionPopulate the organization with realistic sample data. Admin only. Can only be run once per organization (returns 409 on subsequent calls).
Creates:
- 2 teams (Support, Sales)
- 8 demo agents (login with
Demo1234!) - 3 skills with assignments
- 3 shift templates (Morning, Afternoon, Evening)
- 30 days historical contact data
- 2 schedules with shifts
- 5 time-off requests
- PTO balances
Response (200):
{ "success": true, "message": "Sample data loaded successfully", "stats": { "teams": 2, "employees": 8, "skills": 3, "templates": 3, "historicalDays": 30, "schedules": 2, "shifts": 72, "timeOffRequests": 5 }}