Move/reorder items in component library tree
Allows reordering components and items at the same level, reparenting items to different components or parent items, and moving items between components (automatically updates componentId for all descendants). When parent is null, sorts components. When parent is provided, sorts items within that parent. Automatically handles side-effects including conditions cleanup and timeframe updates. Only library components and items (component.projectId is null) can be reordered through this endpoint.
POST
/administration/project-components/tree/sortAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredRequest body
requiredapplication/jsonobjectResponses
200Tree structure updated successfully
messagestringsuccessboolean400Invalid request format, invalid UUIDs, or invalid type values
401Unauthorized - Invalid or missing authentication token
403Insufficient permissions to edit component library
404Component/item not found in library
Request
curl -X POST "https://leadtime.app/api/public/administration/project-components/tree/sort" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch("https://leadtime.app/api/public/administration/project-components/tree/sort", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({})
});import requests
response = requests.post(
"https://leadtime.app/api/public/administration/project-components/tree/sort",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={},
)Response
{
"message": "Products sort updated successfully",
"success": true
}Invalid request format, invalid UUIDs, or invalid type values
Unauthorized - Invalid or missing authentication token
Insufficient permissions to edit component library
Component/item not found in library