لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/sites/folders.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Site folders
Folders group site pages and set the path segment of their URL. This section also covers publishing a folder, unpublishing it, moving it to the trash and restoring it.
Scope: landing | Base URL: https://vibecode.bitrix24.com/v1 | Authorization: X-Api-Key
List site folders
GET /v1/sites/:id/folders
Returns the site's folders.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionSite ID — a positive integer. List: GET /v1/sites |
Parameterscope (query) |
Typestring | Requiredno | DescriptionInternal landing scope: KNOWLEDGE / GROUP / MAINPAGE. Specify it if the site belongs to the corresponding scope. Otherwise 404 ENTITY_NOT_FOUND is returned |
ParameterparentId (query) |
Typenumber | Requiredno | DescriptionParent 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 |
Parameterdeleted (query) |
Typeboolean | Requiredno | Descriptiontrue — 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
curl "https://vibecode.bitrix24.com/v1/sites/233/folders" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
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
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
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 |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success |
Fielddata |
Typearray | DescriptionArray of folders. Empty if no folder matches the conditions |
Fielddata[].id |
Typenumber | DescriptionFolder ID |
Fielddata[].parentId |
Typenumber | null | DescriptionParent folder ID. null — the folder is in the site root |
Fielddata[].siteId |
Typenumber | DescriptionSite ID. List: GET /v1/sites |
Fielddata[].indexPageId |
Typenumber | null | DescriptionID of the folder's index page — a page from GET /v1/pages. null if not assigned |
Fielddata[].active |
Typeboolean | DescriptionWhether the folder is published |
Fielddata[].deleted |
Typeboolean | DescriptionWhether the folder is in the trash |
Fielddata[].title |
Typestring | DescriptionFolder name |
Fielddata[].code |
Typestring | DescriptionFolder symbolic code — the URL segment of its pages |
Fielddata[].createdById |
Typenumber | null | DescriptionID of the user who created the folder. List: GET /v1/users |
Fielddata[].modifiedById |
Typenumber | null | DescriptionID of the user who last modified the folder. List: GET /v1/users |
Fielddata[].dateCreate |
Typestring | null | DescriptionCreation date in ISO 8601 format without a time zone, in Bitrix24 account time, for example 2026-10-16T15:49:43 |
Fielddata[].dateModify |
Typestring | null | DescriptionLast modification date in the same format |
Response example
{
"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:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Site not found or not visible"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid is not a positive integer |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionparentId is not empty and is not a positive integer |
| HTTP400 | CodeINVALID_PARAMS |
Descriptiondeleted is not true or false |
| HTTP400 | CodeINVALID_SCOPE |
Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo site with this id exists, it is not accessible to the key's user, or it belongs to a different scope |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 returned the folder list in an unexpected shape or rejected the request. The reason is in message |
| HTTP409 | CodeLANDING_MODULE_NOT_ENABLED |
DescriptionThe 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 |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionBitrix24 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 |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the landing scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header is missing |
Full list of common API errors — Errors.
Known specifics
- A non-existent parent folder does not cause an error. If the site has no folder with this
parentId, the response is200with an emptydataarray.