https://us-central1-emp-business-playstore.cloudfunctions.netAll API requests require an API key sent via header:
x-api-key: <your-api-key>
or
Authorization: Bearer <your-api-key>Generate an API key from the app: Profile → API Integration → Generate API Key
Keys expire after 1 year and can be revoked from the app.
GET /getEmployeesResponse
{
"success": true,
"count": 2,
"data": [
{
"id": "uid123",
"name": "John Doe",
"email": "john@example.com",
"phone": "+911234567890",
"role": "employee",
"status": "active",
"createdAt": "2025-01-15T10:00:00.000Z",
"lastLogin": "2026-02-27T08:30:00.000Z",
"profileImage": "https://storage.googleapis.com/...",
"balances": {
"overtimeMinutes": 120,
"casualLeaveUsed": 2,
"sickLeaveUsed": 1,
"compOffEarned": 3,
"compOffUsed": 1,
"permissionUsedHrs": 4,
"permissionUsedMins": 30
}
}
],
"timestamp": "2026-02-27T17:12:44.000Z"
}GET /getTasks| Query Param | Type | Default | Description |
|---|---|---|---|
| status | string | — | pending / in_progress / completed |
| employeeId | string | — | Filter by employee UID |
| startDate | ISO date | — | Tasks created after this date |
| endDate | ISO date | — | Tasks created before this date |
| limit | integer | 100 | Max results |
Response
{
"success": true,
"count": 1,
"data": [
{
"id": "taskId123",
"title": "Repair AC Unit",
"description": "Fix the AC at customer site",
"status": "pending",
"priority": "high",
"assignedTo": "empUid123",
"assignedToName": "John Doe",
"createdAt": "2026-02-27T10:00:00.000Z",
"dueDate": "2026-02-28T18:00:00.000Z",
"completedAt": null,
"location": { "address": "123 Main St" },
"customerInfo": { "name": "Jane Smith", "phone": "+919876543210" }
}
],
"timestamp": "2026-02-27T17:12:44.000Z"
}GET /getAttendance| Query Param | Type | Default | Description |
|---|---|---|---|
| employeeId | string | — | Filter by employee UID |
| startDate | ISO date | — | Records after this date |
| endDate | ISO date | — | Records before this date |
| limit | integer | 100 | Max results |
Response
{
"success": true,
"count": 1,
"data": [
{
"id": "attId123",
"employeeId": "empUid123",
"employeeName": "John Doe",
"date": "2026-02-27T00:00:00.000Z",
"clockIn": "2026-02-27T09:00:00.000Z",
"clockOut": "2026-02-27T18:00:00.000Z",
"status": "present",
"location": { "lat": 12.9716, "lng": 77.5946 },
"totalHours": 9
}
],
"timestamp": "2026-02-27T17:12:44.000Z"
}GET /getServices| Query Param | Type | Default | Description |
|---|---|---|---|
| employeeId | string | — | Filter by employee UID |
| startDate | ISO date | — | Completed after this date |
| endDate | ISO date | — | Completed before this date |
| limit | integer | 100 | Max results |
Response
{
"success": true,
"count": 1,
"data": [
{
"id": "svcId123",
"taskId": "taskId123",
"employeeId": "empUid123",
"employeeName": "John Doe",
"customerName": "Jane Smith",
"serviceType": "AC Repair",
"status": "completed",
"completedAt": "2026-02-27T15:30:00.000Z",
"amount": 2500,
"paymentMethod": "cash",
"rating": 5,
"notes": "Replaced compressor"
}
],
"timestamp": "2026-02-27T17:12:44.000Z"
}GET /getRequests| Query Param | Type | Default | Description |
|---|---|---|---|
| type | string | — | permission or leave (omit for both) |
| status | string | — | pending / approved / rejected |
| employeeId | string | — | Filter by employee UID |
| limit | integer | 100 | Max results |
Response
{
"success": true,
"count": 1,
"data": [
{
"id": "reqId123",
"type": "permission",
"employeeId": "empUid123",
"employeeName": "John Doe",
"reason": "Doctor appointment",
"status": "approved",
"date": "2026-02-27",
"fromTime": "14:00",
"toTime": "16:00",
"hours": 2,
"createdAt": "2026-02-26T10:00:00.000Z",
"updatedAt": "2026-02-26T12:00:00.000Z"
}
],
"timestamp": "2026-02-27T17:12:44.000Z"
}GET /getApiAnalyticsResponse
{
"success": true,
"data": {
"apiCallsToday": 42,
"webhookDeliveries": 15,
"totalApiCalls": 1250,
"endpoints": { "getEmployees": 10, "getTasks": 20, "getAttendance": 8, "getServices": 4 },
"webhookEvents": { "task_created": 8, "task_completed": 5 },
"date": "2026-02-27"
},
"timestamp": "2026-02-27T17:12:44.000Z"
}POST /webhook
x-api-key: <your-api-key>
Content-Type: application/jsonBody
{
"webhookUrl": "https://your-crm.com/webhook",
"events": ["task_created", "task_completed", "service_completed", "request_created", "request_updated"]
}{
"event": "task_created",
"timestamp": "2026-02-27T17:12:44.000Z",
"data": {
"taskId": "abc123",
"title": "Repair AC",
"status": "pending",
"assignedTo": "empUid",
"assignedToName": "John Doe",
"adminId": "adminUid"
}
}| HTTP Status | Meaning |
|---|---|
| 401 | Missing, invalid, inactive, or expired API key |
| 405 | HTTP method not allowed (use GET for data endpoints, POST for webhook) |
| 500 | Internal server error |
Error response format
{ "error": "Description of the error" }