Sort todos within an item
Reorders todos within a component item by providing a new sort order array. The sort order determines the display order of todos in the UI and affects condition evaluation order. All todos in the newSortOrder array must belong to the specified item. This operation automatically recalculates conditions if needed and marks the project configuration as changed.
POST
/projects/{projectId}/items/{itemId}/todos/sortAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
projectIdstringrequiredProject UUID
itemIdstringrequiredComponent item UUID
Request body
requiredapplication/jsonnewSortOrderstring[]requiredArray of todo item IDs in the desired sort order
Responses
200Todos successfully reordered
successboolean400Invalid projectId, itemId, or todo IDs in sort order
401Unauthorized - Invalid or missing authentication token
403Insufficient permissions or no access to project
404Item not found or does not belong to the specified project
Request
curl -X POST "https://leadtime.app/api/public/projects/a47dc37b-7693-4d06-b49c-17084b773aff/items/e57dc37b-7693-4d06-b49c-17084b773aff/todos/sort" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"newSortOrder": [
"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"b2c3d4e5-f6g7-8901-bcde-f12345678901"
]
}'const response = await fetch("https://leadtime.app/api/public/projects/a47dc37b-7693-4d06-b49c-17084b773aff/items/e57dc37b-7693-4d06-b49c-17084b773aff/todos/sort", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"newSortOrder": [
"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"b2c3d4e5-f6g7-8901-bcde-f12345678901"
]
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/projects/a47dc37b-7693-4d06-b49c-17084b773aff/items/e57dc37b-7693-4d06-b49c-17084b773aff/todos/sort",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"newSortOrder": [
"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"b2c3d4e5-f6g7-8901-bcde-f12345678901"
]
},
)Response
{
"success": true
}Invalid projectId, itemId, or todo IDs in sort order
Unauthorized - Invalid or missing authentication token
Insufficient permissions or no access to project
Item not found or does not belong to the specified project