## 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`](/docs/chats/management/folder-sources-update).

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 |
|----------|-----|:-----:|---------|
| `folderId` (path) | number | yes | ID of the "All" folder — the `id` of the folder with `type: "system"` and `code: "all"` from [`GET /v1/chats/folders`](/docs/chats/discovery/folders) |

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

## Examples

### curl — personal key

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

### curl — OAuth application

```bash
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 |
|------|-----|---------|
| `success` | boolean | Always `true` on success |
| `data.sources` | array | Sources in the order the interface shows them |
| `data.sources[].folderId` | number | ID of the source's system folder |
| `data.sources[].code` | string | Code of the source — the value to pass in `sourceCodes` of [`PUT /v1/chats/folders/:folderId/sources`](/docs/chats/management/folder-sources-update) |
| `data.sources[].enabled` | boolean | The source is included in the "All" folder |
| `data.sources[].togglable` | boolean | The source can be switched on and off. `false` for showcase sources: they are shown but cannot be switched on or off |
| `data.folders` | array | The sources' system folders — the same fields as in [`GET /v1/chats/folders`](/docs/chats/discovery/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 |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `folderId` is not a positive integer, or a query parameter was sent. Checked before any call to Bitrix24 |
| 404 | `ENTITY_NOT_FOUND` | Bitrix24 answered "not found", the Bitrix24 code is in `error.b24Code` |
| 422 | `METHOD_NOT_YET_AVAILABLE` | The `im 26.1300.0` update is not installed on the Bitrix24 account yet — see the notice at the top of the page |
| 422 | `BITRIX_ERROR` | Bitrix24 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 |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |
| 403 | `SCOPE_DENIED` | The API key does not have the `im` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |
| 401 | `TOKEN_MISSING` | The API key has no Bitrix24 tokens configured |

Full list of common API errors — [Errors](/docs/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

- [Set the sources of the "All" folder](/docs/chats/management/folder-sources-update)
- [Chat folders](/docs/chats/discovery/folders)
- [Folder chats](/docs/chats/discovery/folder-recent)
- [Platform errors](/docs/errors/platform#method_not_yet_available-422)
