API ReferenceWorkspace & Admin Endpoints
API endpoints for managing workspaces, the admin panel, and system operations.
Workspaces
| Method | Endpoint | Description |
|---|
| GET | /api/v1/workspaces | List all workspaces (scoped by role) |
| POST | /api/v1/workspaces | Create workspace |
| GET | /api/v1/workspaces/:wid | Get workspace details |
| GET | /api/v1/workspaces/:wid/stats | Get workspace statistics |
Setup / Onboarding (Public)
These endpoints are used during initial setup before any user exists:
| Method | Endpoint | Description |
|---|
| GET | /api/v1/setup/status | Check if setup is complete |
| GET | /api/v1/setup/branding | Get branding settings |
| POST | /api/v1/setup/verify-license | Verify license key |
| POST | /api/v1/setup/branding | Save branding (logo, name) |
| POST | /api/v1/setup/complete | Complete onboarding (creates admin) |
Admin Panel (super_admin / admin only)
| Method | Endpoint | Description |
|---|
| GET | /api/v1/admin/dashboard | Admin dashboard stats |
| GET | /api/v1/admin/employees | List all employees |
| POST | /api/v1/admin/employees | Create employee |
| DELETE | /api/v1/admin/employees/:id | Delete employee |
| GET | /api/v1/admin/clients | List all clients |
| POST | /api/v1/admin/clients | Create (onboard) a client |
| DELETE | /api/v1/admin/clients/:wid | Delete client |
| GET | /api/v1/admin/assignments | List employee-client assignments |
| POST | /api/v1/admin/assignments | Create assignment |
| DELETE | /api/v1/admin/assignments/:id | Delete assignment |
| POST | /api/v1/admin/impersonate/:uid | Impersonate a user |
System Updates (super_admin only)
| Method | Endpoint | Description |
|---|
| GET | /api/v1/admin/system/check-update | Check for available updates |
| POST | /api/v1/admin/system/update | Trigger self-update |
| GET | /api/v1/admin/system/version | Get current version |
MCP (Model Context Protocol)
| Method | Endpoint | Description |
|---|
| POST | /api/v1/mcp | MCP JSON-RPC endpoint (authenticated) |
Public Report
| Method | Endpoint | Description |
|---|
| GET | /api/v1/report/:slug/stats | Public report statistics (no auth) |
| GET | /api/v1/report/:slug/campaigns | Public report campaigns (no auth) |
Example: Create Workspace
curl -X POST https://YOUR_SERVER/api/v1/workspaces \
-H "Content-Type: application/json" \
-H "Cookie: auth_token=YOUR_JWT_TOKEN" \
-d '{"name": "Client Corp", "slug": "client-corp"}'
Example: Create Employee
curl -X POST https://YOUR_SERVER/api/v1/admin/employees \
-H "Content-Type: application/json" \
-H "Cookie: auth_token=YOUR_JWT_TOKEN" \
-d '{"name": "John Doe", "email": "john@company.com", "password": "securepass123"}'