Get Company by ID API
Overview
Retrieves full details of a corporate company, including associated departments, employee bands, and approval policies.
- Endpoint:
/api/companies/get-by-id - Method:
POST - Access: Super Admin / Platform RM / Corporate Admin
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
id | String (UUID) | Yes | Target company ID |
Request Body Example
{
"id": "c478a846-993d-4c8d-bf8d-d77cb3370e01"
}
Success Response (200 OK)
{
"success": true,
"message": "Company details retrieved successfully",
"data": {
"id": "c478a846-993d-4c8d-bf8d-d77cb3370e01",
"name": "Abbott Healthcare",
"legalName": "Abbott Healthcare India Private Limited",
"gstin": "27AAACA0000A1Z5",
"departments": [
{ "id": "d1-uuid", "name": "Marketing", "costCode": "MKT-01" }
],
"employeeBands": [
{ "id": "b1-uuid", "name": "Band 1", "autoApprovalLimit": "7000.00" }
],
"_count": {
"users": 45,
"bookings": 128,
"invoices": 12
}
}
}
Database Impact
- Tables:
companies,departments,employee_bands,approval_policies - Operations:
SELECTwith relational includes.