Skip to main content

Authentication

This endpoint requires authentication with a Bearer token. Only users with Super Admin or HR Manager roles can update departments.
id
string
required
The unique identifier of the department to update

Request Body

All fields are optional. Only include fields you want to update.
name
string
Department name (2-255 characters)
code
string
Department code (max 50 characters)
description
string
Department description
parent_department_id
string
UUID of the parent department for hierarchical structure
cost_center
string
Cost center identifier (max 100 characters)
status
string
Department status. Must be one of: active, inactive

Response

success
boolean
Indicates if the request was successful
data
object
The updated department object
curl -X PUT https://api.companyflow.com/departments/{id} \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Software Engineering",
    "description": "Software development and engineering team",
    "status": "active"
  }'
{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "company_id": "987fcdeb-51a2-43f7-9c5d-123456789abc",
    "name": "Software Engineering",
    "code": "ENG",
    "description": "Software development and engineering team",
    "parent_department_id": null,
    "cost_center": "CC-100",
    "status": "active",
    "created_at": "2026-03-03T10:00:00Z",
    "updated_at": "2026-03-03T14:30:00Z"
  }
}

Build docs developers (and LLMs) love