For AI agents: markdown of this page — /docs-content-en/entities/tasks/checklist-actions/move-after.md documentation index — /llms.txt
Move an item after another
POST /v1/tasks/:taskId/checklist/:itemId/move-after
Moves a task checklist item and places it after another item.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParametertaskId (path) |
Typenumber | Requiredyes | DescriptionTask ID, a positive integer. List: GET /v1/tasks |
ParameteritemId (path) |
Typenumber | Requiredyes | DescriptionID of the item being moved, a positive integer. List: GET /v1/tasks/:taskId/checklist |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
FieldafterItemId |
Typenumber | Requiredyes | DescriptionID of the item that the itemId item will be placed after, a positive integer. List: GET /v1/tasks/:taskId/checklist — it returns the ID as a string, such as "276", while this field needs a number |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/tasks/4218/checklist/274/move-after" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"afterItemId": 276}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/tasks/4218/checklist/274/move-after" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"afterItemId": 276}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/4218/checklist/274/move-after', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ afterItemId: 276 }),
})
const { success, data } = await res.json()
console.log('New item position:', data?.checkListItem?.sortIndex)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/4218/checklist/274/move-after', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ afterItemId: 276 }),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue if the request succeeded |
Fielddata |
Typeobject | DescriptionResult with a single field, checkListItem |
Fielddata.checkListItem |
Typeobject | DescriptionThe moved item |
Fielddata.checkListItem.id |
Typenumber | DescriptionItem ID |
Fielddata.checkListItem.taskId |
Typenumber | DescriptionTask ID |
Fielddata.checkListItem.parentId |
Typenumber | DescriptionParent item ID. 0 means a top-level item, which is also the checklist name |
Fielddata.checkListItem.title |
Typestring | DescriptionItem text |
Fielddata.checkListItem.sortIndex |
Typenumber | DescriptionNew position of the item among items with the same parent. The smaller the value, the higher the item |
Fielddata.checkListItem.displaySortIndex |
Typestring | DescriptionDisplay number of the item. An empty string in the response |
Fielddata.checkListItem.isComplete |
Typeboolean | DescriptionWhether the item is complete |
Fielddata.checkListItem.isImportant |
Typeboolean | DescriptionWhether the item is marked important |
Fielddata.checkListItem.completedCount |
Typenumber | DescriptionArrives as 0 even when sub-items are complete. To check whether a sub-item is complete, use its isComplete in the item list |
Fielddata.checkListItem.members |
Typearray | DescriptionItem members. An empty array if there are none. For member roles, see Key fields |
Fielddata.checkListItem.attachments |
Typearray | object | DescriptionItem attachments. An empty array if there are none. For the object format, see Key fields |
Fielddata.checkListItem.createdBy |
Typenumber | DescriptionItem author ID. List: GET /v1/users |
Fielddata.checkListItem.userId |
Typenumber | DescriptionID of the employee on whose behalf the call is made. List: GET /v1/users |
Fielddata.checkListItem.copiedId |
Typenumber | null | DescriptionID of the source item if the item was created by copying. Otherwise null |
Fielddata.checkListItem.nodeId |
Typestring | null | DescriptionInternal node key. null in the response |
Response example
{
"success": true,
"data": {
"checkListItem": {
"id": 274,
"copiedId": null,
"userId": 1295,
"createdBy": 1295,
"parentId": 268,
"title": "Agree on the date",
"sortIndex": 2,
"displaySortIndex": "",
"isComplete": false,
"isImportant": false,
"completedCount": 0,
"members": [],
"attachments": [],
"nodeId": null,
"taskId": 4218
}
}
}
Error response example
422 — an item cannot be placed after its own sub-item:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "Parent item cannot be a subitem of itself",
"b24Code": "0"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
DescriptiontaskId is not a positive integer. Message taskId must be a positive integer |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionitemId is not a positive integer. Message itemId must be a positive integer |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe body is not a JSON object, for example an array. Message JSON object body is required |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionafterItemId is missing, passed as a string, or is not a positive integer. Message afterItemId must be a positive integer |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionX-Api-Key is not passed |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no Bitrix24 tokens |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the task scope |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is in read-only mode. error.details.switchUrl contains the URL of the section where the mode is changed |
| HTTP415 | CodeFST_ERR_CTP_INVALID_MEDIA_TYPE |
DescriptionA body with a Content-Type the API does not parse, such as application/xml |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionThe task or the itemId item does not exist, or the employee on whose behalf the call is made cannot see the task. The message is in the Bitrix24 account language; on an English-language account it is Access to task was denied. The API specification declares 404 TASK_NOT_FOUND and 404 NOT_FOUND for this case, but the Bitrix24 accounts we tested return this response instead |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionNo item with the ID from afterItemId. The message is in the Bitrix24 account language, for example "Move item: action unavailable" |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionafterItemId is a sub-item of the item being moved. The message is in the Bitrix24 account language, for example "Parent item cannot be a subitem of itself" |
| HTTP429 | CodeRATE_LIMITED |
DescriptionRequest rate exceeded. The effective cap is in the x-ratelimit-limit header |
Full list of common API errors — Errors.
Known specifics
sortIndex numbers might not start at 0. The moved item gets a number one greater than that of the afterItemId item, and the number of the afterItemId item does not change. If the first of two sub-items numbered 0 and 1 is placed after the second, their numbers become 1 and 2. Item order depends on how the numbers compare, not on whether they are consecutive.