Skip to main content

Delete Department

DELETE /clients/{client_id}/departments/{department_id}

Deletes a department. This is a soft delete -- the record is hidden from all endpoints but historical data is preserved.

Path Parameters

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

Response

Returns 204 No Content on success. No response body.

Example Request

curl -X DELETE "https://api.example.com/v2/clients/aa7cf840-9ca9-46a3-9778-9015d6580d50/departments/d1a2b3c4-e5f6-7890-abcd-ef1234567890" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Behaviour after deletion

When a department is deleted:

  • The department no longer appears in list or detail endpoints
  • Users who were members have the department removed from their departments array
  • Historical data is preserved internally

Error Responses

StatusDescription
401Authentication required
403Insufficient permissions for this client
404Department or client not found
500Server error
{
"error": {
"code": "not_found",
"message": "Department not found",
"details": {
"department_id": "ffffffff-ffff-ffff-ffff-ffffffffffff"
}
}
}