b24_batch
Run up to 50 Bitrix24 REST calls in one ordered batch, chain later calls to earlier results, and reduce API-limit pressure by counting the batch as one request.
Instructions
Run up to 50 REST calls in a single request (chained, with back-references).
Reduces API-limit pressure: 50 sub-calls count as one hit. Commands run in
order; a later command can consume an earlier one's output using Bitrix's
$result[key][field] reference syntax placed literally inside its params.
Args: commands: e.g. [{"key":"make","method":"crm.deal.add","params":{"fields":{"TITLE":"X"}}}, {"key":"note","method":"crm.timeline.comment.add", "params":{"fields":{"ENTITY_ID":"$result[make]","ENTITY_TYPE":"deal","COMMENT":"hi"}}}] halt: stop on first error if true.
Returns: JSON string: {"result": {key: }, "result_error": {key: err}, "result_next": {...}, "result_total": {...}}.
Write safety: with BITRIX_READ_ONLY=1 the whole batch is refused if any command is a write method.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"commands": "<commands>"
},
"name": "b24_batch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| halt | No | Stop the whole batch on the first command error (default false = keep going). | |
| commands | Yes | List of commands, each {'method': str, 'params'?: object, 'key'?: str}. Max 50. Use 'key' to name a command so a later command can reference its result via Bitrix syntax, e.g. params {'ID': '$result[make][ID]'}. | |
| webhook_url | No | Override the default incoming webhook for this call (https://<portal>/rest/<user_id>/<token>/). If omitted, uses personal_webhook, then the X-B24-Webhook HTTP header, then the BITRIX_WEBHOOK_URL env default. | |
| personal_webhook | No | Act as a specific user (their personal incoming webhook). Takes precedence over webhook_url. Required to write to the portal under that user's permissions. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |