Move a department to a new parent or make it a top-level department.
POSThttps://api.aitronos.com/v1/organizations/{organization_id}/departments/{department_id}/reparent
Changes the parent of a department, effectively moving it within the hierarchy. The operation updates the department's parent_id, path, and depth fields, as well as those of all its descendants. Circular references (making a department its own ancestor) are rejected.
organization_id string required
The unique identifier of the organization (format: org_*).
department_id string required
The unique identifier of the department to move (format: dept_*).
new_parent_id string | null required
The ID of the new parent department (format: dept_*). Set to null to make the department a top-level department.
The updated department object with its new hierarchical position.
cURL
- Bash
- Python
- Python
- JavaScript
curl -X POST https://api.aitronos.com/v1/organizations/org_xyz789/departments/dept_def456/reparent \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"new_parent_id": "dept_ghi789"
}'