For AI agents: markdown of this page — /docs-content-en/chats/sidebar.md documentation index — /llms.txt
Load the chat's right panel
POST /v1/chats/:dialogId/sidebar
Loads the chat's right panel — members, files, your individual chat link, links from messages and favorites — in one Bitrix24 batch call instead of seven separate requests.
List only the blocks you need in the body: the response carries exactly those. Each block returns the same data as its own method: list of members in the v2 mode, chat file list, individual chat link, a chat's links and their number, favorite messages and their number. The request takes one place in the Bitrix24 account queue however many blocks it carries. The blocks your platform version accepts are in the data.sidebarBlocks field of the chat configuration.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ParameterdialogId (path) |
Typestring | Requiredyes | DescriptionDialog ID: chatXXX for a group chat, a numeric user ID for a private dialog, me for your own private dialog. List — GET /v1/chats/recent |
Query parameters are not accepted: any of them is refused with 400 INVALID_PARAMS.
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldblocks |
Typeobject | Requiredyes | DescriptionPanel blocks, one to seven of them: members, files, inviteLink, links, linksCounter, favorites, favoritesCount. The value of each block is an object. Send only the blocks listed in data.sidebarBlocks of the chat configuration |
Fieldblocks.members |
Typeobject | Requiredno | DescriptionChat members — the first page of the list of members in the v2 mode |
Fieldblocks.members.limit |
Typenumber | Requiredno | DescriptionHow many members to return, 1 to 200. Defaults to 50. A value outside the range is set to the nearest bound, and the block then carries meta.requestedLimit and meta.appliedLimit |
Fieldblocks.files |
Typeobject | Requiredno | DescriptionChat files — the first page of the chat file list |
Fieldblocks.files.chatId |
Typenumber | Requiredyes | DescriptionRequired in the files block. Numeric chat ID — the data.chat.id field of loading the chat. For a group chat chatXXX it is the number XXX; for a private dialog it cannot be taken from dialogId |
Fieldblocks.files.group |
Typestring[] | Requiredyes | DescriptionRequired in the files block. Panel tabs: MEDIA — Media, FILE — Files, AUDIO — Voice, each once |
Fieldblocks.files.limit |
Typenumber | Requiredno | DescriptionHow many list entries to return, 1 to 200. A value outside the range is set to the nearest bound, and the block then carries meta.requestedLimit and meta.appliedLimit |
Fieldblocks.inviteLink |
Typeobject | Requiredno | DescriptionYour individual chat link. It takes no fields — pass {}. The link is only read and never created |
Fieldblocks.links |
Typeobject | Requiredno | DescriptionLinks from the chat's messages — the first page of a chat's links |
Fieldblocks.links.chatId |
Typenumber | Requiredyes | DescriptionRequired in the links block. Numeric chat ID — the data.chat.id field of loading the chat |
Fieldblocks.links.limit |
Typenumber | Requiredno | DescriptionHow many links to return, 1 to 200. Defaults to 50. A value outside the range is set to the nearest bound, and the block then carries meta.requestedLimit and meta.appliedLimit |
Fieldblocks.linksCounter |
Typeobject | Requiredno | DescriptionThe number of links in the chat |
Fieldblocks.linksCounter.chatId |
Typenumber | Requiredyes | DescriptionRequired in the linksCounter block. Numeric chat ID — the data.chat.id field of loading the chat |
Fieldblocks.favorites |
Typeobject | Requiredno | DescriptionYour favorite messages of the chat — the first page of favorite messages |
Fieldblocks.favorites.chatId |
Typenumber | Requiredyes | DescriptionRequired in the favorites block. Numeric chat ID — the data.chat.id field of loading the chat |
Fieldblocks.favorites.limit |
Typenumber | Requiredno | DescriptionHow many entries to return, 1 to 50. Defaults to 50. A value outside the range is set to the nearest bound, and the block then carries meta.requestedLimit and meta.appliedLimit |
Fieldblocks.favoritesCount |
Typeobject | Requiredno | DescriptionThe number of your favorite messages in the chat |
Fieldblocks.favoritesCount.chatId |
Typenumber | Requiredyes | DescriptionRequired in the favoritesCount block. Numeric chat ID — the data.chat.id field of loading the chat |
Other body fields and block fields are refused with 400 INVALID_PARAMS. The check runs before any Bitrix24 call.
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/chats/chat1945/sidebar" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"blocks": {"members": {"limit": 50}, "files": {"chatId": 1945, "group": ["MEDIA", "FILE", "AUDIO"], "limit": 50}, "inviteLink": {}, "links": {"chatId": 1945, "limit": 50}, "linksCounter": {"chatId": 1945}, "favorites": {"chatId": 1945, "limit": 50}, "favoritesCount": {"chatId": 1945}}}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/chats/chat1945/sidebar" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"blocks": {"members": {"limit": 50}, "files": {"chatId": 1945, "group": ["MEDIA", "FILE", "AUDIO"], "limit": 50}, "inviteLink": {}, "links": {"chatId": 1945, "limit": 50}, "linksCounter": {"chatId": 1945}, "favorites": {"chatId": 1945, "limit": 50}, "favoritesCount": {"chatId": 1945}}}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat1945/sidebar', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
blocks: {
members: { limit: 50 },
files: { chatId: 1945, group: ['MEDIA', 'FILE', 'AUDIO'], limit: 50 },
inviteLink: {},
links: { chatId: 1945, limit: 50 },
linksCounter: { chatId: 1945 },
favorites: { chatId: 1945, limit: 50 },
favoritesCount: { chatId: 1945 },
},
}),
})
const { data } = await res.json()
for (const [name, block] of Object.entries(data)) {
if (!block.ok) console.log(`Block ${name} not loaded:`, block.error.code)
}
console.log('Chat link:', data.inviteLink.ok ? data.inviteLink.data?.sharingLink.url ?? 'none' : '—')
console.log('Links in the chat:', data.linksCounter.ok ? data.linksCounter.data.counter : '—')
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/chat1945/sidebar', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
blocks: {
members: { limit: 50 },
files: { chatId: 1945, group: ['MEDIA', 'FILE', 'AUDIO'], limit: 50 },
inviteLink: {},
links: { chatId: 1945, limit: 50 },
linksCounter: { chatId: 1945 },
favorites: { chatId: 1945, limit: 50 },
favoritesCount: { chatId: 1945 },
},
}),
})
const { data } = await res.json()
for (const [name, block] of Object.entries(data)) {
if (!block.ok) console.log(`Block ${name} not loaded:`, block.error.code)
}
console.log('Chat link:', data.inviteLink.ok ? data.inviteLink.data?.sharingLink.url ?? 'none' : '—')
console.log('Links in the chat:', data.linksCounter.ok ? data.linksCounter.data.counter : '—')
Response fields
* in the table is the block name: members, files, inviteLink, links, linksCounter, favorites or favoritesCount.
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue even when a block failed to load |
Fielddata |
Typeobject | DescriptionBlock responses in the order members, files, inviteLink, links, linksCounter, favorites, favoritesCount. Only the requested blocks are present |
Fielddata.*.ok |
Typeboolean | Descriptiontrue — the block loaded, false — this block was refused. A refused block does not affect the others |
Fielddata.*.data |
Typeobject | null | DescriptionWith ok: true — the same as the data field of the block's own method: members, files, chat link, chat links, number of links, favorites, number of favorites. For inviteLink with no link — null |
Fielddata.*.meta |
Typeobject | DescriptionOnly when the block's limit was set to a bound: requestedLimit — the value sent, appliedLimit — the value applied |
Fielddata.*.error.code |
Typestring | DescriptionWith ok: false — the refusal code: a Bitrix24 code such as ACCESS_DENIED, or a platform code — BLOCK_NOT_RETURNED, a read-only key refusal WRITE_BLOCKED_READONLY_KEY or COWORK_READONLY, a limit code RATE_LIMITED or OPERATION_TIME_LIMIT, an authorization code TOKEN_EXPIRED or PORTAL_CREDENTIALS_REJECTED — as on Errors |
Fielddata.*.error.message |
Typestring | DescriptionRefusal text |
Fielddata.*.error.hint |
Typestring | DescriptionOnly with the platform codes RATE_LIMITED, OPERATION_TIME_LIMIT, TOKEN_EXPIRED, PORTAL_CREDENTIALS_REJECTED, COWORK_READONLY: what to do next. COWORK_READONLY in the inviteLink block has no such field: that refusal is made before the call to Bitrix24 and carries details.method |
Fielddata.*.error.retryAfter |
Typenumber | DescriptionOnly with RATE_LIMITED and OPERATION_TIME_LIMIT: seconds to wait before retrying. A block has no Retry-After header of its own |
Fielddata.*.error.scope |
Typestring | DescriptionOnly with the limit codes and PORTAL_CREDENTIALS_REJECTED: what the refusal applies to — portal or apiKey |
Fielddata.*.error.details |
Typeobject | DescriptionWith WRITE_BLOCKED_READONLY_KEY: method, keyName, currentMode, switchUrl. With COWORK_READONLY in the inviteLink block — only method |
Response example
All seven blocks loaded. The file, employee, link and message cards are shortened; the full set of fields is on the pages of the blocks' own methods:
{
"success": true,
"data": {
"members": {
"ok": true,
"data": {
"relations": [
{ "id": 71, "chatId": 1945, "userId": 1, "role": "owner" },
{ "id": 77, "chatId": 1945, "userId": 4, "role": "member" }
],
"users": [
{ "id": 1, "name": "John Brown", "firstName": "John" },
{ "id": 4, "name": "Anna Grey", "firstName": "Anna" }
],
"nextCursor": { "role": "member", "relationId": 77 }
}
},
"files": {
"ok": true,
"data": {
"list": [
{ "id": 3101, "messageId": 1003, "chatId": 1945, "authorId": 5, "dateCreate": "2026-11-09T10:00:00+00:00", "fileId": 7701, "subType": "AUDIO", "group": "AUDIO" }
],
"files": [
{ "id": 7701, "chatId": 1945, "type": "audio", "name": "voice.ogg", "size": 2048, "isVoiceNote": true, "duration": 12 }
],
"users": [
{ "id": 5, "active": true, "name": "John Brown", "type": "user", "bot": false }
],
"tariffRestrictions": { "isHistoryLimitExceeded": false }
}
},
"inviteLink": {
"ok": true,
"data": {
"sharingLink": {
"id": 18,
"entityId": "1945",
"entityType": "chat",
"code": "Xk9pQ2mZ7rT4vB1c",
"type": "individual",
"dateCreate": "2026-09-25T10:00:00+00:00",
"dateExpire": null,
"requireApproval": false,
"url": "https://example.bitrix24.com/online/?IM_CODE=Xk9pQ2mZ7rT4vB1c"
}
}
},
"links": {
"ok": true,
"data": {
"users": [
{ "id": 6, "active": true, "name": "Anna Smith", "type": "user", "bot": false }
],
"tariffRestrictions": { "isHistoryLimitExceeded": false },
"list": [
{
"id": 12,
"messageId": 34213,
"chatId": 1945,
"authorId": 6,
"dateCreate": "2026-03-03T11:44:09+00:00",
"url": { "source": "https://example.com/page", "richData": { "id": null, "type": null, "name": null, "description": null, "previewUrl": null, "link": null } }
}
]
}
},
"linksCounter": { "ok": true, "data": { "counter": 1 } },
"favorites": {
"ok": true,
"data": {
"list": [
{
"id": 15,
"messageId": 846,
"chatId": 1945,
"authorId": 7,
"dateCreate": "2026-11-17T10:05:00+00:00",
"message": { "id": 846, "chatId": 1945, "authorId": 12, "date": "2026-11-16T09:30:00+00:00", "text": "The report is ready" }
}
],
"users": [{ "id": 12, "active": true, "name": "Anna Smith", "type": "user" }],
"files": []
}
},
"favoritesCount": { "ok": true, "data": { "counter": 1 } }
}
}
A read-only key requested files and the link, and Bitrix24 denied access to the files. Both blocks are refused, the response status is 200:
{
"success": true,
"data": {
"files": {
"ok": false,
"error": { "code": "ACCESS_DENIED", "message": "You do not have access to this chat" }
},
"inviteLink": {
"ok": false,
"error": {
"code": "WRITE_BLOCKED_READONLY_KEY",
"message": "Key is in read-only mode. Switch the key to read and write in /keys to allow Bitrix24 data changes.",
"details": {
"method": "im.v2.Chat.SharingLink.getIndividual",
"keyName": "Reports dashboard",
"currentMode": "READONLY",
"switchUrl": "/keys"
}
}
}
}
}
Error response example
400 — blocks names a block the panel does not have. Checked before any Bitrix24 call:
{
"success": false,
"error": {
"code": "INVALID_PARAMS",
"message": "`blocks.avatar` is not a panel block. Accepted: members, files, inviteLink, links, linksCounter, favorites, favoritesCount."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
Descriptionblocks is missing or empty, a block other than members, files, inviteLink, links, linksCounter, favorites, favoritesCount, a block that is not an object, an extra field in the body or in a block, a limit that is not a JSON integer, a chatId of the files, links, linksCounter, favorites, favoritesCount blocks that is missing or not a positive integer, a files.group that is not a list of MEDIA, FILE, AUDIO without repeats, or a query parameter. Checked before any Bitrix24 call |
| HTTP200 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionInside a block, not for the whole response: the key is read-only (a Cowork service chat key in read-only mode is refused with a different code — COWORK_READONLY, the row below). The inviteLink block is always refused and is not sent to Bitrix24. The members block is refused on the same conditions as the list of members in the v2 mode: an application key with a user session, a management key, a key whose owner is unconfirmed, or a private dialog not found among the same employee's recent dialogs. The links, linksCounter, favorites, favoritesCount blocks only read and load for such a key, as do the other blocks |
| HTTP200 | CodeCOWORK_READONLY |
DescriptionInside the members block: a Cowork service chat key in read-only mode. A retry does not help: the chat stays in this mode. The inviteLink block of such a key gets the same COWORK_READONLY code — that refusal is made before the call to Bitrix24 and carries details.method, but no hint. The files, links, linksCounter, favorites, favoritesCount blocks still load |
| HTTP200 | CodeBLOCK_NOT_RETURNED |
DescriptionInside a block: the Bitrix24 response for this block is empty or could not be read |
| HTTP200 | CodeERROR_METHOD_NOT_FOUND |
DescriptionInside the favorites and favoritesCount blocks: the account's Bitrix24 version does not support favorite messages. The other blocks still load |
| HTTP200 | CodeRATE_LIMITED |
DescriptionInside a block: Bitrix24 limited the request rate on this batch command. The wait is in the block's retryAfter |
| HTTP200 | CodeOPERATION_TIME_LIMIT |
DescriptionInside a block: Bitrix24 paused this block's method for your key — the method used up its operating-time budget. The wait is in the block's retryAfter |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key lacks the im scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no Bitrix24 tokens configured |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 refused the whole batch call. No block is loaded |
| HTTP429 | CodeQUEUE_TIMEOUT |
DescriptionThe batch call did not get a place in the Bitrix24 account queue in time. The response carries a Retry-After header; no block is loaded |
| HTTP502 | CodeME_ALIAS_RESOLUTION_FAILED |
DescriptionThe user for the me alias could not be determined |
| HTTP502 | CodeBITRIX_UNAVAILABLE |
DescriptionBitrix24 is unavailable or returned a server error |
| HTTP503 | CodeBITRIX_TIMEOUT |
DescriptionBitrix24 did not answer within the time limit. No block is loaded |
Full list of common API errors — Errors.
Known specifics
One call instead of several, but longer than each. Bitrix24 runs the batch commands one after another, so the request takes about as long as that many separate calls in a row. The time allowed for the answer grows with the number of blocks. If Bitrix24 does not answer the batch in time, no block arrives. Retry the request or load the blocks with their own methods.
The block list depends on the platform version. An unknown block refuses the whole request with 400 INVALID_PARAMS, so do not probe for a block with a test request. Read data.sidebarBlocks of the chat configuration. If the field is absent, the platform accepts only members, files and inviteLink. If the method answers 404, load the blocks with their own methods.
First page only. Load further pages with the blocks' own methods: members with cursorRole and cursorRelationId from data.members.data.nextCursor, files with lastId of the last entry of data.files.data.list, links with offset equal to the number of links already received, favorites with lastId equal to the id of the last entry of data.favorites.data.list. Search in links and favorites is available only through their own methods.
The link is not created. The inviteLink block only reads the link. With no link the block comes back as { "ok": true, "data": null }. To create one, use the individual chat link method. Chat links exist for group chats and channels — request the block there. A private dialog has no link, and the block comes back as { "ok": true, "data": null }.
A Bitrix24 refusal in a block carries the Bitrix24 code. The block's data matches the response of its own method; refusal codes do not. The standalone method responds with 422 BITRIX_ERROR and puts the Bitrix24 code in error.b24Code, while the block puts that code directly in error.code, for example ACCESS_DENIED. Limits and authorization keep the platform codes — RATE_LIMITED, OPERATION_TIME_LIMIT, TOKEN_EXPIRED, PORTAL_CREDENTIALS_REJECTED — with a hint, and the limits also with a retryAfter wait.
The members block can make you a member. As with the list of members in the v2 mode: if the chat allows auto-join — a comment chat, a collab or a task chat, for example — the request adds the current user to the members.