curl -X GET "https://api.companyflow.com/companies/{company_id}/departments?page=1&page_size=10&status=active" \
-H "Authorization: Bearer YOUR_TOKEN"
curl -X GET "https://api.companyflow.com/companies/{company_id}/departments?search=engineering" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"success": true,
"data": {
"items": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"company_id": "987fcdeb-51a2-43f7-9c5d-123456789abc",
"name": "Engineering",
"code": "ENG",
"description": "Software engineering and development",
"parent_department_id": null,
"cost_center": "CC-100",
"status": "active",
"created_at": "2026-03-03T10:00:00Z",
"updated_at": "2026-03-03T10:00:00Z"
},
{
"id": "234e5678-e89b-12d3-a456-426614174001",
"company_id": "987fcdeb-51a2-43f7-9c5d-123456789abc",
"name": "Human Resources",
"code": "HR",
"description": "Human resources management",
"parent_department_id": null,
"cost_center": "CC-200",
"status": "active",
"created_at": "2026-03-03T11:00:00Z",
"updated_at": "2026-03-03T11:00:00Z"
}
],
"total": 2,
"page": 1,
"page_size": 10,
"total_pages": 1
}
}
{
"success": false,
"message": "invalid page"
}
{
"success": false,
"message": "missing authorization header"
}
Departments
List Departments
Retrieve a paginated list of departments for a company
GET
/
companies
/
{company_id}
/
departments
curl -X GET "https://api.companyflow.com/companies/{company_id}/departments?page=1&page_size=10&status=active" \
-H "Authorization: Bearer YOUR_TOKEN"
curl -X GET "https://api.companyflow.com/companies/{company_id}/departments?search=engineering" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"success": true,
"data": {
"items": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"company_id": "987fcdeb-51a2-43f7-9c5d-123456789abc",
"name": "Engineering",
"code": "ENG",
"description": "Software engineering and development",
"parent_department_id": null,
"cost_center": "CC-100",
"status": "active",
"created_at": "2026-03-03T10:00:00Z",
"updated_at": "2026-03-03T10:00:00Z"
},
{
"id": "234e5678-e89b-12d3-a456-426614174001",
"company_id": "987fcdeb-51a2-43f7-9c5d-123456789abc",
"name": "Human Resources",
"code": "HR",
"description": "Human resources management",
"parent_department_id": null,
"cost_center": "CC-200",
"status": "active",
"created_at": "2026-03-03T11:00:00Z",
"updated_at": "2026-03-03T11:00:00Z"
}
],
"total": 2,
"page": 1,
"page_size": 10,
"total_pages": 1
}
}
{
"success": false,
"message": "invalid page"
}
{
"success": false,
"message": "missing authorization header"
}
Authentication
This endpoint requires authentication with a Bearer token. Only users with Super Admin or HR Manager roles can list departments.string
required
The unique identifier of the company
Query Parameters
integer
default:"1"
Page number for pagination
integer
default:"10"
Number of items per page
string
Filter by department status. Must be one of:
active, inactivestring
Search departments by name or code
Response
boolean
Indicates if the request was successful
object
Paginated department list
Show Pagination Response
Show Pagination Response
array
Array of department objects
Show Department Object
Show Department Object
string
Unique department identifier
string
Company identifier
string
Department name
string
Department code
string
Department description
string
Parent department ID if hierarchical
string
Cost center identifier
string
Department status (active/inactive)
string
ISO 8601 timestamp of creation
string
ISO 8601 timestamp of last update
integer
Total number of departments matching the query
integer
Current page number
integer
Number of items per page
integer
Total number of pages
curl -X GET "https://api.companyflow.com/companies/{company_id}/departments?page=1&page_size=10&status=active" \
-H "Authorization: Bearer YOUR_TOKEN"
curl -X GET "https://api.companyflow.com/companies/{company_id}/departments?search=engineering" \
-H "Authorization: Bearer YOUR_TOKEN"
{
"success": true,
"data": {
"items": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"company_id": "987fcdeb-51a2-43f7-9c5d-123456789abc",
"name": "Engineering",
"code": "ENG",
"description": "Software engineering and development",
"parent_department_id": null,
"cost_center": "CC-100",
"status": "active",
"created_at": "2026-03-03T10:00:00Z",
"updated_at": "2026-03-03T10:00:00Z"
},
{
"id": "234e5678-e89b-12d3-a456-426614174001",
"company_id": "987fcdeb-51a2-43f7-9c5d-123456789abc",
"name": "Human Resources",
"code": "HR",
"description": "Human resources management",
"parent_department_id": null,
"cost_center": "CC-200",
"status": "active",
"created_at": "2026-03-03T11:00:00Z",
"updated_at": "2026-03-03T11:00:00Z"
}
],
"total": 2,
"page": 1,
"page_size": 10,
"total_pages": 1
}
}
{
"success": false,
"message": "invalid page"
}
{
"success": false,
"message": "missing authorization header"
}