Skip to main content

Update Department

PATCH /clients/{client_id}/departments/{department_id}

Updates a department's name or description. All fields are optional -- only include fields you want to change.

Path Parameters

ParameterTypeDescription
client_idstring (uuid)Unique identifier for the client organization
department_idstring (uuid)Unique identifier for the department

Request Body

FieldTypeDescription
namestringNew department name. Must be unique within the client.
descriptionstring | nullNew description. Send null to clear the description.

Fields not updatable via API

FieldReason
idImmutable identifier
member_countComputed from membership, not directly settable
created_atImmutable audit timestamp

Response

Returns the updated Department object with status 200 OK.

Example Requests

Update name only

curl -X PATCH "https://api.example.com/v2/clients/aa7cf840-9ca9-46a3-9778-9015d6580d50/departments/d1a2b3c4-e5f6-7890-abcd-ef1234567890" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Engineering & DevOps"
}'

Update description only

curl -X PATCH "https://api.example.com/v2/clients/aa7cf840-9ca9-46a3-9778-9015d6580d50/departments/d1a2b3c4-e5f6-7890-abcd-ef1234567890" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"description": "Software development, infrastructure, and DevOps teams"
}'

Clear description

curl -X PATCH "https://api.example.com/v2/clients/aa7cf840-9ca9-46a3-9778-9015d6580d50/departments/d1a2b3c4-e5f6-7890-abcd-ef1234567890" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"description": null
}'

Example Response

{
"id": "d1a2b3c4-e5f6-7890-abcd-ef1234567890",
"name": "Engineering & DevOps",
"description": "Software development, infrastructure, and DevOps teams",
"member_count": 45,
"created_at": "2026-01-10T09:00:00.000Z",
"updated_at": "2026-02-24T22:00:00.000Z"
}

Partial update behaviour

Omitted fields are left unchanged. Only the fields you send are updated.

ScenarioRequest bodyResult
Rename only{ "name": "New Name" }Name changes, description unchanged
Update description{ "description": "New desc" }Description changes, name unchanged
Clear description{ "description": null }Description set to null, name unchanged

Error Responses

StatusDescription
400Invalid request body (e.g. empty string for name)
401Authentication required
403Insufficient permissions for this client
404Department or client not found
409A department with the new name already exists in this client
500Server error

404 -- department not found

{
"error": {
"code": "not_found",
"message": "Department not found",
"details": {
"department_id": "ffffffff-ffff-ffff-ffff-ffffffffffff"
}
}
}

409 -- name conflict

{
"error": {
"code": "conflict",
"message": "A department with this name already exists",
"details": {
"name": "Engineering & DevOps"
}
}
}