For AI agents: markdown of this page — /docs-content-en/entities/tasks/dependencies-bulk.md documentation index — /llms.txt

Dependencies of several tasks

POST /v1/tasks/dependencies/bulk

Returns predecessors for several tasks at once, up to 50 per call.

Request fields (body)

Field Type Required Description
FieldtaskIds Typearray Requiredyes DescriptionTask IDs — numbers or decimal strings: "4203" equals 4203. Up to 500 elements and up to 50 unique IDs; duplicates are counted once. Task list: GET /v1/tasks

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/tasks/dependencies/bulk" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "taskIds": [4203, "4201", 4203, 999999999]
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/tasks/dependencies/bulk" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "taskIds": [4203, "4201", 4203, 999999999]
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/dependencies/bulk', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    taskIds: [4203, '4201', 4203, 999999999],
  }),
})

const { success, data, meta } = await res.json()
for (const [taskId, deps] of Object.entries(data.results)) {
  console.log(taskId, 'depends on', deps.map((dep) => dep.id))
}
for (const [taskId, error] of Object.entries(data.errors)) {
  console.log(taskId, 'could not be read:', error.code)
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/tasks/dependencies/bulk', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    taskIds: [4203, '4201', 4203, 999999999],
  }),
})

const { success, data, meta } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue if the request was accepted. Refusals for individual tasks are in data.errors
Fielddata.results Typeobject DescriptionTask dependencies: the key is the task ID as a string, the value is an array of predecessors
Fielddata.results.<taskId>[].id Typenumber DescriptionID of the predecessor task. Get: GET /v1/tasks/:id
Fielddata.results.<taskId>[].title Typestring | null DescriptionTitle of the predecessor task. null if Bitrix24 did not return it
Fielddata.errors Typeobject DescriptionRefusals by task: the key is the task ID as a string, the value is an error object
Fielddata.errors.<taskId>.code Typestring DescriptionRefusal code — one of five, see "Refusals for individual tasks" below
Fielddata.errors.<taskId>.message Typestring DescriptionRefusal text
Fieldmeta.requested Typenumber DescriptionNumber of unique IDs in the request: duplicates are counted once. Always equals succeeded + failed
Fieldmeta.succeeded Typenumber DescriptionHow many tasks were read
Fieldmeta.failed Typenumber DescriptionHow many tasks ended up in data.errors
Fieldmeta.direction Typestring DescriptionAlways predecessors
Fieldmeta.source Typestring DescriptionAlways RELATED_TASKS

Response example

The request from the examples: the duplicate 4203 is counted once, the string "4201" is read as a number, and task 999999999 does not exist.

JSON
{
  "success": true,
  "data": {
    "results": {
      "4201": [],
      "4203": [
        {
          "id": 4199,
          "title": "Prepare the estimate"
        },
        {
          "id": 4201,
          "title": "Approve the budget"
        }
      ]
    },
    "errors": {
      "999999999": {
        "code": "TASK_NOT_FOUND",
        "message": "Task not found."
      }
    }
  },
  "meta": {
    "requested": 3,
    "succeeded": 2,
    "failed": 1,
    "direction": "predecessors",
    "source": "RELATED_TASKS"
  }
}

Error response example

400 — taskIds contains more than 50 unique IDs:

JSON
{
  "success": false,
  "error": {
    "code": "BATCH_LIMIT_EXCEEDED",
    "message": "taskIds carries 51 unique ids; at most 50 are accepted"
  }
}

Errors

Refusals of the whole request:

HTTP Code Description
HTTP400 CodeBATCH_LIMIT_EXCEEDED DescriptionMore than 50 unique IDs. Message taskIds carries N unique ids; at most 50 are accepted
HTTP400 CodeBATCH_LIMIT_EXCEEDED DescriptionMore than 500 elements in the original array; checked before the elements are parsed. Message taskIds carries N elements; at most 500 are read, and at most 50 unique ids are accepted
HTTP400 CodeINVALID_PARAMS DescriptionAn element is not a positive integer. The message names its position in the original array, counting from zero: taskIds[1] must be a positive integer id …
HTTP400 CodeINVALID_REQUEST DescriptionThe body is not a JSON object. Message Request body must be an object with a taskIds array
HTTP400 CodeINVALID_REQUEST DescriptiontaskIds is missing, is not an array, or the array is empty. A request without a body gets the same response. Message taskIds must be a non-empty array
HTTP401 CodeMISSING_API_KEY DescriptionX-Api-Key was not passed
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no Bitrix24 tokens
HTTP403 CodeSCOPE_DENIED DescriptionThe key has no task scope
HTTP415 CodeFST_ERR_CTP_INVALID_MEDIA_TYPE DescriptionA non-empty body with a Content-Type other than application/json
HTTP429 CodeRATE_LIMITED DescriptionBulk call rate exceeded. Retry the request after the delay given in the retry-after header

Refusals for individual tasks arrive in data.errors with a 200 response — even when every task is refused. Check data.errors, not only data.results:

Code Description
CodeTASK_NOT_FOUND DescriptionThe task does not exist or is not visible to the key
CodeRATE_LIMITED DescriptionBitrix24 throttled this sub-call. Retry later
CodeOPERATION_TIME_LIMIT DescriptionBitrix24 asked to reduce the load. Retry later
CodeUPSTREAM_INCOMPLETE DescriptionNo usable response was received for this task
CodeDEPENDENCY_LIMIT_EXCEEDED DescriptionThe task has more than 1000 dependencies

Full list of common API errors — Errors.

Known specifics

The rate limit applies per Bitrix24 account, not per key. The bulk call is limited to 30 requests per minute per Bitrix24 account. All keys of one account share the limit, and refused requests count toward it too. The limit is divided across the platform's replicas: the effective value is in the x-ratelimit-limit header, and the number of requests left is in x-ratelimit-remaining.

See also