Create Employee Band API
Overview
Creates a new Employee Band for a company with specified auto-approval and booking limit rules.
- Endpoint:
/api/bands/create - Method:
POST - Access: Corporate Admin / Admin
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
companyId | String (UUID) | Yes | Target company ID |
name | String | Yes | Band name (e.g. "Band 1", "Executive L1") |
code | String | No | Band code (e.g. "B1", "L1") |
description | String | No | Description of the band level |
autoApprovalLimit | Number | No | Auto approval limit amount (Default: 7000.00) |
maxBookingLimit | Number | No | Maximum booking limit per trip |
Request Body Example
{
"companyId": "c478a846-993d-4c8d-bf8d-d77cb3370e01",
"name": "Band 1",
"code": "B1",
"description": "Junior Executive Level Band",
"autoApprovalLimit": 7000,
"maxBookingLimit": 25000
}
Success Response (201 Created)
{
"success": true,
"message": "Employee Band created successfully",
"data": {
"id": "b1234567-89ab-cdef-0123-456789abcdef",
"companyId": "c478a846-993d-4c8d-bf8d-d77cb3370e01",
"name": "Band 1",
"code": "B1",
"description": "Junior Executive Level Band",
"autoApprovalLimit": "7000.00",
"maxBookingLimit": "25000.00",
"active": true,
"createdAt": "2026-08-24T12:00:00.000Z",
"updatedAt": "2026-08-24T12:00:00.000Z",
"_count": {
"users": 0
}
}
}
Error Response (400 Bad Request)
{
"success": false,
"message": "Employee Band with name 'Band 1' already exists for this company",
"data": null
}
Database Impact
- Table:
employee_bands(EmployeeBandmodel) - Operations:
INSERTintoemployee_bandstable with foreign keycompanyId.