Bulk-update team parent relationships
PUT
/admin/org-chart
const url = 'https://shoehorn.example.com/api/v1/admin/org-chart';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"updates":[{"team_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","parent_team_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://shoehorn.example.com/api/v1/admin/org-chart \ --header 'Content-Type: application/json' \ --data '{ "updates": [ { "team_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "parent_team_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] }'Admin-only. Each update sets a team’s parent_team_id; pass null
(or omit) to make the team a root team. Updates run inside one
transaction. The server walks ancestry to reject cycles before
applying — if any update would create a cycle, the entire request
fails with CIRCULAR_REFERENCE.
Request Body required
Section titled “Request Body required ” Media type application/json
object
updates
required
Array<object>
object
team_id
required
string format: uuid
parent_team_id
Set null to make the team a root team.
string format: uuid
Example generated
{ "updates": [ { "team_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "parent_team_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}Responses
Section titled “ Responses ”Updates applied
Media type application/json
object
success
boolean
updated
Number of updates applied.
integer
Example generated
{ "success": true, "updated": 1}Returned for an empty updates array, an invalid UUID, or a
cycle. Cycles use the error code CIRCULAR_REFERENCE.
Caller lacks admin permission