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
| Parameter | Type | Description |
|---|---|---|
client_id | string (uuid) | Unique identifier for the client organization |
department_id | string (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
departmentsarray - Historical data is preserved internally
Error Responses
| Status | Description |
|---|---|
| 401 | Authentication required |
| 403 | Insufficient permissions for this client |
| 404 | Department or client not found |
| 500 | Server error |
{
"error": {
"code": "not_found",
"message": "Department not found",
"details": {
"department_id": "ffffffff-ffff-ffff-ffff-ffffffffffff"
}
}
}
Related Endpoints
- List Departments - Browse all departments
- Create Department - Create a new department
- Remove Members - Remove users from a department before deletion