Skip to main content

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​

FieldTypeRequiredDescription
companyIdString (UUID)YesTarget company ID
nameStringYesBand name (e.g. "Band 1", "Executive L1")
codeStringNoBand code (e.g. "B1", "L1")
descriptionStringNoDescription of the band level
autoApprovalLimitNumberNoAuto approval limit amount (Default: 7000.00)
maxBookingLimitNumberNoMaximum 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 (EmployeeBand model)
  • Operations: INSERT into employee_bands table with foreign key companyId.