API & Integration
Integrate custom employee management websites, commission portals, or payroll systems directly with real-time attendance events and RESTful endpoints.
Overview & Health Ping
Public endpoint to test system latency and server availability.
All requests are served over HTTPS with company-scoped rate limiting. Responses are formatted as structured JSON with explicit status flags, ISO 8601 timestamps, and pagination metadata.
/api/ping
{
"success": true,
"message": "AMS API is running",
"version": "v1",
"timestamp": "2026-09-20T02:32:00+06:00"
}
Authentication & Token Abilities
Secure bearer token scheme with scoped permissions.
Pass your API token in the HTTP Authorization header of every API request:
Authorization: Bearer 1|qW89fHn38v10aZ9...
/api/v1/me
{
"success": true,
"data": {
"token_name": "Commission Portal Integration",
"abilities": ["read:attendance", "read:employees"],
"company": {
"id": 1,
"name": "Acme Corporation",
"code": "ACME001"
}
}
}
Granted Permission Scopes
| Scope Code | Description | Endpoints Granted |
|---|---|---|
| read:employees | Query staff profiles, departments & branches. | GET /employees, GET /employees/{code} |
| read:attendance | Access daily logs, metrics & monthly aggregates. | GET /attendance, GET /attendance/summary |
| read:leaves | Retrieve leave applications, status & balances. | GET /leaves, GET /leaves/balances |
| read:webhooks | View webhook endpoints and delivery attempt logs. | GET /webhooks/endpoints, GET /webhooks/deliveries |
| manage:webhooks | Register, update, pause, delete endpoints & retry logs. | POST/PATCH/DELETE /webhooks/endpoints |
Employees API
Query staff profiles, departments, and active shift schedules.
/api/v1/employees
Retrieve paginated employee directory with active shift context.
- status: active | inactive | suspended
- search: Filter by name, email, or code
- per_page: 1 to 50 (default: 30)
{
"success": true,
"data": [
{
"employee_code": "EMP-00101",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"email": "[email protected]",
"department": "Engineering",
"branch": "Headquarters",
"status": "active"
}
]
}
/api/v1/employees/{code}
Retrieve a single employee profile by employee code.
{
"success": true,
"data": {
"employee_code": "EMP-00101",
"full_name": "John Doe",
"email": "[email protected]",
"current_shift": {
"name": "Morning Shift",
"start_time": "09:00:00",
"end_time": "17:00:00"
}
}
}
Attendance & Metrics API
Query daily attendance records, punch times, and monthly aggregates.
/api/v1/attendance
Query attendance records calculated from biometric hardware logs.
- date: YYYY-MM-DD (e.g. 2026-08-22)
- date_from / date_to: Range query
- employee_code: Specific staff ID
- status: present | absent | leave | holiday
{
"employee_code": "EMP-00101",
"attendance_date": "2026-08-22",
"status": "present",
"check_in": "2026-08-22T08:58:12+06:00",
"check_out": "2026-08-22T17:05:40+06:00",
"working_hours": 8.12,
"late_minutes": 0,
"is_late": false
}
/api/v1/attendance/summary
Compute monthly attendance summary aggregates per employee.
{
"employee_code": "EMP-00101",
"month": "2026-08",
"summary": {
"total_days": 31,
"present_days": 22,
"absent_days": 1,
"working_hours": 176.5,
"overtime_hours": 4.0
}
}
Leaves API
Query leave applications, approvals, and annual quotas.
/api/v1/leaves/balances
{
"employee_code": "EMP-00101",
"year": 2026,
"balances": [
{
"category": "Annual Leave",
"allocated": 20,
"used": 4,
"remaining": 16
}
]
}
Webhook Endpoint Management API
Programmatically register, edit, and audit webhook destinations.
/api/v1/webhooks/endpoints
{
"name": "Partner Commission Portal",
"url": "https://partner-portal.com/webhooks/ams",
"secret": "sec_98f4b1d798a74e56c82d41a7",
"events": ["attendance.punch", "attendance.processed"]
}
Real-time Webhook Catalog
AMS pushes facts in real-time as HTTP POST JSON payloads.
{
"event": "attendance.punch",
"company_code": "ISBAH001",
"delivery_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-08-23T09:01:44+06:00",
"data": {
"employee_code": "EMP-00101",
"employee_name": "John Doe",
"punch_time": "2026-08-23T09:01:44+06:00",
"punch_type": "check_in",
"is_first_punch_today": true,
"attendance_date": "2026-08-23"
}
}
{
"event": "attendance.processed",
"company_code": "ISBAH001",
"delivery_id": "550e8400-e29b-41d4-a716-446655440001",
"timestamp": "2026-08-22T23:59:00+06:00",
"data": {
"employee_code": "EMP-00101",
"attendance_date": "2026-08-22",
"status": "absent",
"working_hours": 0,
"late_minutes": 0
}
}
HMAC Signature Verification
Verify X-AMS-Signature header to ensure authenticity.
<?php
$secret = 'YOUR_WEBHOOK_SECRET_KEY';
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_AMS_SIGNATURE'] ?? '';
$expected = 'sha256=' . hash_hmac('sha256', $payload, $secret);
if (! hash_equals($expected, $signature)) {
http_response_code(401);
exit('Invalid Webhook Signature');
}
OpenAPI Sandbox
Explore schemas and test requests live in your browser.
SDK & Code Generators
Ready-to-use production code snippets in cURL, JavaScript, PHP, and Python.