API Reference
Complete API documentation for integrating with ezyWFM.
Base URL
https://your-domain.com/api
Authentication
ezyWFM supports two authentication methods:
Session-Based Authentication
For web UI integrations, use NextAuth.js session cookies. Users authenticate through the login page, and the session cookie is automatically included in subsequent requests.
API Key Authentication
For server-to-server integrations, use API keys:
Authorization: Bearer YOUR_API_KEYOr:
X-API-Key: YOUR_API_KEYAPI keys are only shown once when created. Store them securely.
Creating API Keys
- Go to Settings → API Keys
- Click Create API Key
- Enter a name and select permissions
- Copy the key immediately (it won't be shown again)
Available Permissions
| Permission | Description |
|------------|-------------|
| import:historical | Import historical contact data |
| import:employees | Sync employees from HRIS |
| import:agent-states | Push real-time agent states |
Error Handling
All errors follow a consistent format:
{ "error": "Error message", "details": { }}HTTP Status Codes
| Code | Meaning | |------|---------| | 200 | Success | | 201 | Created | | 400 | Bad Request (validation error) | | 401 | Unauthorized (not logged in) | | 403 | Forbidden (insufficient permissions) | | 404 | Not Found | | 409 | Conflict (duplicate resource) | | 429 | Too Many Requests (rate limited) | | 500 | Internal Server Error | | 503 | Service Unavailable |
Rate Limiting
API requests are rate limited to prevent abuse:
| Endpoint Type | Limit | |---------------|-------| | Authentication | 10/minute | | Sensitive operations | 5/minute | | External API (v1) | 1000/minute | | General API | 100/minute |
When rate limited, you'll receive a 429 response with Retry-After header.
Pagination
List endpoints support pagination:
GET /api/endpoint?page=1&limit=50
Response includes:
{ "data": [...], "page": 1, "limit": 50, "total": 250}API Sections
- Authentication - Registration, login, password reset
- Time & Attendance - Clock, breaks, time-off
- Scheduling - Schedules, shifts, templates
- Adherence - Agent states, alerts
- Analytics - Metrics, reports, exports
- Self-Service - Employee-facing endpoints
- Admin - User and settings management
- External Integration - v1 import endpoints