## List site folders

`GET /v1/sites/:id/folders`

Returns the site's folders.

## Parameters

| Parameter | Type | Required | Description |
|----------|-----|:-----:|---------|
| `id` (path) | number | yes | Site ID — a positive integer. List: [`GET /v1/sites`](/docs/entities/sites/list) |
| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` / `GROUP` / `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned |
| `parentId` (query) | number | no | Parent folder ID — `data[].id` from this same list. Only folders nested directly in it are returned. An empty value `?parentId=` returns only folders in the site root. Without the parameter, folders of all levels are returned |
| `deleted` (query) | boolean | no | `true` — only folders in the trash, `false` — only folders outside the trash. Without the parameter, folders in the trash are not returned |

The `parentId` and `deleted` parameters can be passed together: the response contains folders that match both conditions. The method has no `limit` or `offset` parameters. Other query parameters, such as `select`, are ignored, and the response contains all folder fields.

## Examples

### curl — personal key

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

### curl — OAuth application

```bash
curl "https://vibecode.bitrix24.com/v1/sites/233/folders" \
  -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/sites/233/folders', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log(`Folders: ${data.length}`)
```

### JavaScript — OAuth application

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

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

## Response fields

| Field | Type | Description |
|------|-----|---------|
| `success` | boolean | `true` on success |
| `data` | array | Array of folders. Empty if no folder matches the conditions |
| `data[].id` | number | Folder ID |
| `data[].parentId` | number \| null | Parent folder ID. `null` — the folder is in the site root |
| `data[].siteId` | number | Site ID. List: [`GET /v1/sites`](/docs/entities/sites/list) |
| `data[].indexPageId` | number \| null | ID of the folder's index page — a page from [`GET /v1/pages`](/docs/entities/pages/list). `null` if not assigned |
| `data[].active` | boolean | Whether the folder is published |
| `data[].deleted` | boolean | Whether the folder is in the trash |
| `data[].title` | string | Folder name |
| `data[].code` | string | Folder symbolic code — the URL segment of its pages |
| `data[].createdById` | number \| null | ID of the user who created the folder. List: [`GET /v1/users`](/docs/entities/users/list) |
| `data[].modifiedById` | number \| null | ID of the user who last modified the folder. List: [`GET /v1/users`](/docs/entities/users/list) |
| `data[].dateCreate` | string \| null | Creation date in ISO 8601 format without a time zone, in Bitrix24 account time, for example `2026-10-16T15:49:43` |
| `data[].dateModify` | string \| null | Last modification date in the same format |

## Response example

```json
{
  "success": true,
  "data": [
    {
      "id": 121,
      "parentId": null,
      "siteId": 233,
      "indexPageId": null,
      "active": false,
      "deleted": false,
      "title": "Docs test archive",
      "code": "archive",
      "createdById": 1317,
      "modifiedById": 1317,
      "dateCreate": "2026-10-16T15:49:55",
      "dateModify": "2026-10-16T15:49:55"
    },
    {
      "id": 119,
      "parentId": 117,
      "siteId": 233,
      "indexPageId": null,
      "active": false,
      "deleted": false,
      "title": "Docs test sneakers",
      "code": "sneakers",
      "createdById": 1317,
      "modifiedById": 1317,
      "dateCreate": "2026-10-16T15:49:53",
      "dateModify": "2026-10-16T15:49:53"
    },
    {
      "id": 117,
      "parentId": null,
      "siteId": 233,
      "indexPageId": null,
      "active": false,
      "deleted": false,
      "title": "Docs test catalog",
      "code": "catalog",
      "createdById": 1317,
      "modifiedById": 1317,
      "dateCreate": "2026-10-16T15:49:43",
      "dateModify": "2026-10-16T15:49:43"
    }
  ]
}
```

## Error response example

404 — site not found:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Site not found or not visible"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|-----|---------|
| 400 | `INVALID_PARAMS` | `id` is not a positive integer |
| 400 | `INVALID_PARAMS` | `parentId` is not empty and is not a positive integer |
| 400 | `INVALID_PARAMS` | `deleted` is not `true` or `false` |
| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |
| 404 | `ENTITY_NOT_FOUND` | No site with this `id` exists, it is not accessible to the key's user, or it belongs to a different `scope` |
| 422 | `BITRIX_ERROR` | Bitrix24 returned the folder list in an unexpected shape or rejected the request. The reason is in `message` |
| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is not available on the Bitrix24 account. Ask the account administrator to enable it — while the module is disabled, retrying the request returns the same refusal |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access: the key's user has no permissions for this site or no administrator permissions, or the feature is unavailable on the Bitrix24 account |
| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |
| 401 | `TOKEN_MISSING` | The API key has no configured tokens |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |

Full list of common API errors — [Errors](/docs/errors).

## Known specifics

- **A non-existent parent folder does not cause an error.** If the site has no folder with this `parentId`, the response is `200` with an empty `data` array.

## See also

- [Create a folder](/docs/entities/sites/folders/create)
- [Update a folder](/docs/entities/sites/folders/update)
- [Move a folder to the trash](/docs/entities/sites/folders/trash)
- [Restore a folder](/docs/entities/sites/folders/restore)
- [Site folders](/docs/entities/sites/folders)
- [List sites](/docs/entities/sites/list)
