For AI agents: markdown of this page — /docs-content-en/chats/management/folder-sources.md documentation index — /llms.txt

Sources of the "All" folder

The method ships in the im 26.1300.0 update and is not yet available on all Bitrix24 accounts. If the update has not reached your Bitrix24 account yet, the API returns 422 METHOD_NOT_YET_AVAILABLE — this means the method has not been released on the account yet, not that the integration is broken.

GET /v1/chats/folders/:folderId/sources

Returns the sources of the "All" folder and which of them are enabled. The "All" folder gathers chats from several messenger sections — sources: tasks, collabs, Open Channels and others. To change the set of enabled sources, use PUT /v1/chats/folders/:folderId/sources.

Works only with the "All" folder: other folders have no sources. Not every Bitrix24 account shows the "All" folder: if it is not in the folder list, it is switched off on that account.

The call requires a write-capable key: the first GET may create system folders, save the set of sources in the "All" folder and carry over previously pinned chats. A read-only key gets 403 WRITE_BLOCKED_READONLY_KEY before any Bitrix24 call.

Parameters

Parameter Type Required Description
ParameterfolderId (path) Typenumber Requiredyes DescriptionID of the "All" folder — the id of the folder with type: "system" and code: "all" from GET /v1/chats/folders

There are no query parameters. Any query parameter is rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/chats/folders/7/sources" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/chats/folders/7/sources" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/folders/7/sources', {
  headers: { 'X-Api-Key': 'YOUR_API_KEY' },
})

const { data } = await res.json()
const enabled = data.sources.filter((s) => s.enabled).map((s) => s.code)
console.log('Enabled:', enabled)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/folders/7/sources', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()
const enabled = data.sources.filter((s) => s.enabled).map((s) => s.code)
console.log('Enabled:', enabled)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.sources Typearray DescriptionSources in the order the interface shows them
Fielddata.sources[].folderId Typenumber DescriptionID of the source's system folder
Fielddata.sources[].code Typestring DescriptionCode of the source — the value to pass in sourceCodes of PUT /v1/chats/folders/:folderId/sources
Fielddata.sources[].enabled Typeboolean DescriptionThe source is included in the "All" folder
Fielddata.sources[].togglable Typeboolean DescriptionThe source can be switched on and off. false for showcase sources: they are shown but cannot be switched on or off
Fielddata.folders Typearray DescriptionThe sources' system folders — the same fields as in GET /v1/chats/folders

Response example

JSON
{
  "success": true,
  "data": {
    "sources": [
      { "folderId": 2, "code": "tasksTask", "enabled": true, "togglable": true },
      { "folderId": 4, "code": "collab", "enabled": false, "togglable": true },
      { "folderId": 6, "code": "openChannel", "enabled": false, "togglable": false }
    ],
    "folders": [
      {
        "id": 2,
        "type": "system",
        "code": "tasksTask",
        "title": "Tasks",
        "sort": 3,
        "visible": true,
        "description": "Task chats",
        "displaysNestedInRoot": false,
        "definition": { "recentSection": "tasksTask", "parentChatId": 0 }
      }
    ]
  }
}

Error response example

422 — the folder is not "All":

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "This action is unavailable for this folder.",
    "b24Code": "FOLDER_OPERATION_NOT_SUPPORTED"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionfolderId is not a positive integer, or a query parameter was sent. Checked before any call to Bitrix24
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 answered "not found", the Bitrix24 code is in error.b24Code
HTTP422 CodeMETHOD_NOT_YET_AVAILABLE DescriptionThe im 26.1300.0 update is not installed on the Bitrix24 account yet — see the notice at the top of the page
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned an error, the Bitrix24 code is in error.b24Code: FOLDER_OPERATION_NOT_SUPPORTED — the folder has no sources or a concurrent write to the same folder is in progress. In the second case nothing is written, and the call can be retried. FOLDER_NOT_FOUND — no such folder, FOLDER_ACCESS_DENIED — another user's folder
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable or returned a server error
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured

Full list of common API errors — Errors.

Known specifics

  • The mandatory source is not shown in data.sources: it cannot be switched off. Sources unavailable to the user are not shown either.

See also