Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Rampop01/HR-Platform/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
The HCMatrix API provides programmatic access to employee data, dashboard metrics, and authentication services for your HR management platform.Base URL
All API calls in HCMatrix go through a Next.js proxy to avoid CORS issues:/api/auth/- Authentication endpoints/api/v1/- Core API endpoints
Proxy Setup
The API client uses a proxy-based architecture where all requests are routed through/api/proxy endpoint. This design:
- Prevents CORS issues by keeping requests same-origin
- Centralizes authentication token handling
- Provides a consistent error handling layer
Making API Calls
The core API client function handles all HTTP requests:Headers
All requests include:Accept: application/json- Required for all requestsAuthorization: Bearer {token}- Added when token is providedContent-Type: application/json- Added only for requests with a body
Response Handling
The API client:- Validates that responses are JSON format
- Throws errors for non-JSON responses
- Extracts error messages from response body
- Returns typed response data
Error Format
API errors are thrown with messages extracted from:Authentication
Most API endpoints require a bearer token obtained through the login endpoint. Include the token in the Authorization header:Available Endpoints
Authentication
- POST /api/auth/login - User login
- POST /api/v1/logout - User logout
Dashboard
- GET /api/v1/dashboard - Get dashboard metrics
Employees
- GET /api/v1/employee - List employees with pagination
- GET /api/v1/employee? - Search employees
- GET /api/v1/employee/ - Get employee details
Data Models
- Employee - Basic employee information
- EmployeeDetail - Extended employee information
- DashboardData - Dashboard metrics
