[{"data":1,"prerenderedAt":14},["ShallowReactive",2],{"docs-entities\u002Fsites\u002Ffolders":3,"docs-tabs-entities\u002Fsites\u002Ffolders":6},{"content":4,"lastmod":5},"# Site folders\n\nFolders 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.\n\n**Scope:** `landing` | **Base URL:** `https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1` | **Authorization:** `X-Api-Key`\n\n## Operations\n\n- [List folders](.\u002Ffolders\u002Flist.md) — `GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`\n- [Create a folder](.\u002Ffolders\u002Fcreate.md) — `POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders`\n- [Update a folder](.\u002Ffolders\u002Fupdate.md) — `PATCH \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId`\n- [Move a folder to the trash](.\u002Ffolders\u002Ftrash.md) — `POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Ftrash`\n- [Restore a folder](.\u002Ffolders\u002Frestore.md) — `POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Frestore`\n- [Publish a folder](.\u002Ffolders\u002Fpublication.md) — `POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Fpublication`\n- [Unpublish a folder](.\u002Ffolders\u002Funpublish.md) — `POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Funpublish`\n\n## Site scope\n\nAll methods accept the optional `scope` query parameter: `KNOWLEDGE`, `GROUP` or `MAINPAGE`. Pass it when the site belongs to a knowledge base, a group or the main page. Without it, the folders of such a site are not found and the method responds with `404 ENTITY_NOT_FOUND`.\n\n## Publication and trash\n\n- A new folder is created unpublished.\n- Publishing a folder also publishes all of its parent folders up to the site root. The site itself keeps its current state.\n- Unpublishing a folder unpublishes the folder and all of its parent folders. Nested folders stay published.\n- A folder in the trash keeps its publication flag, and it can be unpublished only after it is restored. Nested folders are not moved to the trash.\n- The folder's pages go to the trash together with it. When the folder is restored, they come back unpublished.\n- While the parent folder is in the trash, a nested folder cannot be unpublished, and an unpublished nested folder cannot be published: the response is `422 BITRIX_ERROR`.\n- The folder list without the `deleted` filter does not show folders in the trash.\n\n## Typical scenario\n\n1. Create a folder — `POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders`, the response contains the folder's `data.id`.\n2. Create a page in this folder — [`POST \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Fcreate) with the `folderId` field.\n3. Publish the page and the folder — `POST \u002Fv1\u002Fpages\u002F:id\u002Fpublication` and `POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Fpublication`.\n\n## See also\n\n- [Sites](\u002Fdocs\u002Fentities\u002Fsites)\n- [Pages](\u002Fdocs\u002Fentities\u002Fpages)\n","2026-10-16",{"folders\u002Flist.md":7,"folders\u002Fcreate.md":8,"folders\u002Fupdate.md":9,"folders\u002Ftrash.md":10,"folders\u002Frestore.md":11,"folders\u002Fpublication.md":12,"folders\u002Funpublish.md":13},"## List site folders\n\n`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`\n\nReturns the site's folders.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Site ID — a positive integer. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned |\n| `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 |\n| `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 |\n\nThe `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.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log(`Folders: ${data.length}`)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data` | array | Array of folders. Empty if no folder matches the conditions |\n| `data[].id` | number | Folder ID |\n| `data[].parentId` | number \\| null | Parent folder ID. `null` — the folder is in the site root |\n| `data[].siteId` | number | Site ID. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `data[].indexPageId` | number \\| null | ID of the folder's index page — a page from [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist). `null` if not assigned |\n| `data[].active` | boolean | Whether the folder is published |\n| `data[].deleted` | boolean | Whether the folder is in the trash |\n| `data[].title` | string | Folder name |\n| `data[].code` | string | Folder symbolic code — the URL segment of its pages |\n| `data[].createdById` | number \\| null | ID of the user who created the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data[].modifiedById` | number \\| null | ID of the user who last modified the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `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` |\n| `data[].dateModify` | string \\| null | Last modification date in the same format |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 121,\n      \"parentId\": null,\n      \"siteId\": 233,\n      \"indexPageId\": null,\n      \"active\": false,\n      \"deleted\": false,\n      \"title\": \"Docs test archive\",\n      \"code\": \"archive\",\n      \"createdById\": 1317,\n      \"modifiedById\": 1317,\n      \"dateCreate\": \"2026-10-16T15:49:55\",\n      \"dateModify\": \"2026-10-16T15:49:55\"\n    },\n    {\n      \"id\": 119,\n      \"parentId\": 117,\n      \"siteId\": 233,\n      \"indexPageId\": null,\n      \"active\": false,\n      \"deleted\": false,\n      \"title\": \"Docs test sneakers\",\n      \"code\": \"sneakers\",\n      \"createdById\": 1317,\n      \"modifiedById\": 1317,\n      \"dateCreate\": \"2026-10-16T15:49:53\",\n      \"dateModify\": \"2026-10-16T15:49:53\"\n    },\n    {\n      \"id\": 117,\n      \"parentId\": null,\n      \"siteId\": 233,\n      \"indexPageId\": null,\n      \"active\": false,\n      \"deleted\": false,\n      \"title\": \"Docs test catalog\",\n      \"code\": \"catalog\",\n      \"createdById\": 1317,\n      \"modifiedById\": 1317,\n      \"dateCreate\": \"2026-10-16T15:49:43\",\n      \"dateModify\": \"2026-10-16T15:49:43\"\n    }\n  ]\n}\n```\n\n## Error response example\n\n404 — site not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Site not found or not visible\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `id` is not a positive integer |\n| 400 | `INVALID_PARAMS` | `parentId` is not empty and is not a positive integer |\n| 400 | `INVALID_PARAMS` | `deleted` is not `true` or `false` |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 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` |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned the folder list in an unexpected shape or rejected the request. The reason is in `message` |\n| 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 |\n| 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 |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **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.\n\n## See also\n\n- [Create a folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Fcreate)\n- [Update a folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Fupdate)\n- [Move a folder to the trash](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Ftrash)\n- [Restore a folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Frestore)\n- [Site folders](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders)\n- [List sites](\u002Fdocs\u002Fentities\u002Fsites\u002Flist)\n","## Create folder\n\n`POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders`\n\nCreates a folder on a site. A folder groups pages: its symbolic code becomes a segment of their URL.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Site identifier — a positive integer. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `title` | string | yes | Folder name, a non-empty string |\n| `code` | string | no | Folder symbolic code — the URL segment of its pages. If omitted, it is generated from `title`: `Docs test catalog` → `docstestcatalog` |\n| `parentId` | number \\| null | no | Identifier of a parent folder of this site. List: [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist). Omitted or `null` — the folder is created at the site root |\n| `indexPageId` | number \\| null | no | Identifier of the folder home page — a page of the same site. List: [`GET \u002Fv1\u002Fpages?filter[siteId]=:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"title\": \"Docs test catalog\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"title\": \"Docs test catalog\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ title: 'Docs test catalog' }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Folder ID:', data.id)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ title: 'Docs test catalog' }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data.id` | number | Folder identifier |\n| `data.parentId` | number \\| null | Parent folder identifier. `null` — the folder is at the site root |\n| `data.siteId` | number | Site identifier |\n| `data.indexPageId` | number \\| null | Identifier of the folder home page — a page from [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist). `null` when not assigned |\n| `data.active` | boolean | Whether the folder is published |\n| `data.deleted` | boolean | Whether the folder is in the trash |\n| `data.title` | string | Folder name |\n| `data.code` | string | Folder symbolic code — the URL segment of its pages |\n| `data.createdById` | number \\| null | Identifier of the user who created the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.modifiedById` | number \\| null | Identifier of the user who last modified the folder |\n| `data.dateCreate` | string \\| null | Creation date in ISO 8601 without a time zone, in the Bitrix24 account's local time, e.g. `2026-10-16T11:44:24` |\n| `data.dateModify` | string \\| null | Last modification date in the same format |\n\n## Response example\n\n201 — folder created:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 109,\n    \"parentId\": null,\n    \"siteId\": 109,\n    \"indexPageId\": null,\n    \"active\": false,\n    \"deleted\": false,\n    \"title\": \"Docs test catalog\",\n    \"code\": \"docstestcatalog\",\n    \"createdById\": 1317,\n    \"modifiedById\": 1317,\n    \"dateCreate\": \"2026-10-16T11:44:24\",\n    \"dateModify\": \"2026-10-16T11:44:24\"\n  }\n}\n```\n\n## Error response example\n\n400 — the name is missing:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"MISSING_REQUIRED_FIELDS\",\n    \"message\": \"title is required\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `MISSING_REQUIRED_FIELDS` | The request body is empty or not an object |\n| 400 | `MISSING_REQUIRED_FIELDS` | `title` is missing |\n| 400 | `READONLY_FIELD` | The body contains a read-only field: `id`, `siteId`, `active`, `deleted`, `createdById`, `modifiedById`, `dateCreate`, `dateModify` |\n| 400 | `INVALID_PARAMS` | The body contains a field other than `title`, `code`, `parentId`, `indexPageId` |\n| 400 | `INVALID_PARAMS` | `title` is empty, `title` or `code` is not a string, `parentId` or `indexPageId` is neither a positive integer nor `null` |\n| 400 | `INVALID_PARAMS` | `id` is not a positive integer |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 404 | `ENTITY_NOT_FOUND` | No site with this `id`, the site is not accessible to the key's user, or it belongs to a different `scope` |\n| 404 | `ENTITY_NOT_FOUND` | The created folder is not found when read back |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the creation, for example `indexPageId` points to a page of another site. The reason is in `message` |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access: the key's user is not an administrator, or the feature is unavailable on the Bitrix24 account |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The API key is read-only |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **A new folder is not published.** The response has `active: false`. Publish it with [`POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Fpublication`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Fpublication) — its parent folders are published along with it.\n\n## See also\n\n- [List site folders](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist)\n- [Update folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Fupdate)\n- [Publish folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Fpublication)\n","## Update folder\n\n`PATCH \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId`\n\nChanges the name, symbolic code, parent folder or home page of a folder. Pass only the fields you change.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Site identifier — a positive integer. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `folderId` (path) | number | yes | Identifier of a folder on this site. List: [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `title` | string | no | New folder name, a non-empty string |\n| `code` | string | no | New folder symbolic code — the URL segment of its pages |\n| `parentId` | number \\| null | no | Identifier of the new parent folder on this site. List: [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist). `null` moves the folder to the site root. If the field is omitted, the folder keeps its current parent |\n| `indexPageId` | number \\| null | no | Identifier of the folder home page — a page of the same site. List: [`GET \u002Fv1\u002Fpages?filter[siteId]=:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist). `null` clears the assignment |\n\nPass at least one field.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F109\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"indexPageId\": 1073}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F109\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"indexPageId\": 1073}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F109', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ indexPageId: 1073 }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Folder home page:', data.indexPageId)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F109', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ indexPageId: 1073 }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data.id` | number | Folder identifier |\n| `data.parentId` | number \\| null | Parent folder identifier. `null` — the folder is at the site root |\n| `data.siteId` | number | Site identifier |\n| `data.indexPageId` | number \\| null | Identifier of the folder home page — a page from [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist). `null` when not assigned |\n| `data.active` | boolean | Whether the folder is published |\n| `data.deleted` | boolean | Whether the folder is in the trash |\n| `data.title` | string | Folder name |\n| `data.code` | string | Folder symbolic code — the URL segment of its pages |\n| `data.createdById` | number \\| null | Identifier of the user who created the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.modifiedById` | number \\| null | Identifier of the user who last modified the folder |\n| `data.dateCreate` | string \\| null | Creation date in ISO 8601 without a time zone, in the Bitrix24 account's local time, e.g. `2026-10-16T11:44:24` |\n| `data.dateModify` | string \\| null | Last modification date in the same format |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 109,\n    \"parentId\": null,\n    \"siteId\": 109,\n    \"indexPageId\": 1073,\n    \"active\": false,\n    \"deleted\": false,\n    \"title\": \"Docs test catalog\",\n    \"code\": \"docstestcatalog\",\n    \"createdById\": 1317,\n    \"modifiedById\": 1317,\n    \"dateCreate\": \"2026-10-16T11:44:24\",\n    \"dateModify\": \"2026-10-16T11:45:06\"\n  }\n}\n```\n\n## Error response example\n\n404 — parent folder not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Parent folder not found in this site or not visible\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `MISSING_REQUIRED_FIELDS` | The request body is empty or not an object |\n| 400 | `READONLY_FIELD` | The body contains a read-only field: `id`, `siteId`, `active`, `deleted`, `createdById`, `modifiedById`, `dateCreate`, `dateModify` |\n| 400 | `INVALID_PARAMS` | The body contains a field other than `title`, `code`, `parentId`, `indexPageId` |\n| 400 | `INVALID_PARAMS` | `title` is empty, `title` or `code` is not a string, `parentId` or `indexPageId` is neither a positive integer nor `null` |\n| 400 | `INVALID_PARAMS` | `id` or `folderId` is not a positive integer |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 404 | `ENTITY_NOT_FOUND` | No site with this `id`, the site is not accessible to the key's user, or it belongs to a different `scope` |\n| 404 | `ENTITY_NOT_FOUND` | No folder with this `folderId` on this site, or it is not accessible |\n| 404 | `ENTITY_NOT_FOUND` | The `parentId` folder does not exist on this site or is not accessible |\n| 404 | `ENTITY_NOT_FOUND` | The folder was not found after the operation: a concurrent request moved or deleted it |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the change, for example `indexPageId` points to a missing page or a page of another site. The reason is in `message` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access: the key's user is not an administrator, or the feature is unavailable on the Bitrix24 account |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The API key is read-only |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **Assigning a home page does not move the page into the folder.** After `indexPageId` is set, the page's `folderId` in [`GET \u002Fv1\u002Fpages\u002F:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Fget) stays the same.\n\n## See also\n\n- [List site folders](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist)\n- [Create folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Fcreate)\n- [Get a page](\u002Fdocs\u002Fentities\u002Fpages\u002Fget)\n","## Move a folder to the trash\n\n`POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Ftrash`\n\nMoves the folder to the trash together with its pages.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Site ID — a positive integer. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `folderId` (path) | number | yes | ID of a folder on this site. List: [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned |\n\nThe request body is empty or `{}`. Any field in the body is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\u002F117\u002Ftrash\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\u002F117\u002Ftrash\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\u002F117\u002Ftrash', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log('In the trash:', data.deleted)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\u002F117\u002Ftrash', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data.id` | number | Folder ID |\n| `data.parentId` | number \\| null | Parent folder ID. `null` — the folder is in the site root |\n| `data.siteId` | number | Site ID. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `data.indexPageId` | number \\| null | ID of the folder's index page — a page from [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist). `null` if not assigned |\n| `data.active` | boolean | Whether the folder is published |\n| `data.deleted` | boolean | Whether the folder is in the trash |\n| `data.title` | string | Folder name |\n| `data.code` | string | Folder code — the URL segment of its pages |\n| `data.createdById` | number \\| null | ID of the user who created the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.modifiedById` | number \\| null | ID of the user who last modified the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.dateCreate` | string \\| null | Creation date in ISO 8601 format without a time zone: Bitrix24 account time, `2026-10-16T15:49:43` |\n| `data.dateModify` | string \\| null | Last modification date in the same format |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 117,\n    \"parentId\": null,\n    \"siteId\": 233,\n    \"indexPageId\": null,\n    \"active\": true,\n    \"deleted\": true,\n    \"title\": \"Docs test catalog\",\n    \"code\": \"catalog\",\n    \"createdById\": 1317,\n    \"modifiedById\": 1317,\n    \"dateCreate\": \"2026-10-16T15:49:43\",\n    \"dateModify\": \"2026-10-16T15:50:42\"\n  }\n}\n```\n\n## Error response example\n\n404 — folder not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Folder not found in this site or not visible\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `id` or `folderId` is not a positive integer |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 400 | `INVALID_PARAMS` | A request body was passed. The method accepts an empty body or `{}` |\n| 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` |\n| 404 | `ENTITY_NOT_FOUND` | No folder with this `folderId` exists on this site, or it is not accessible |\n| 404 | `ENTITY_NOT_FOUND` | The folder was not found after the operation — a concurrent request moved or deleted it |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not confirm the folder operation or rejected it. The reason is in `message` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access: the key's user has no permissions for this site and no administrator rights, or the feature is unavailable on the Bitrix24 account |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The API key is read-only |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **The folder's publication is kept.** A published folder keeps `active: true` in the trash too. It can be unpublished only after [restoring](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Frestore) it: for a folder in the trash, [`POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Funpublish`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Funpublish) responds with `422 BITRIX_ERROR`.\n- **Nested folders are not moved to the trash.** They keep `deleted: false` and are visible in [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist) without a filter. While the parent folder is in the trash, unpublishing a nested folder and publishing an unpublished nested folder both respond with `422 BITRIX_ERROR`.\n- **The folder's pages become unavailable.** [`GET \u002Fv1\u002Fpages\u002F:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Fget) returns `404` for such a page. After the [folder is restored](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Frestore), its pages come back unpublished.\n- **Moving to the trash again succeeds without an error.** For a folder that is already in the trash the response is `200`, and the folder stays in the trash.\n\n## See also\n\n- [Restore a folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Frestore)\n- [List folders](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist)\n- [Unpublish a folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Funpublish)\n","## Restore folder\n\n`POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Frestore`\n\nRestores a folder from the trash together with its pages.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Site identifier — a positive integer. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `folderId` (path) | number | yes | Identifier of a folder on this site. List: [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned |\n\nThe request body is empty or `{}`. Any field in the body is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F111\u002Frestore\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F111\u002Frestore\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F111\u002Frestore', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log('In trash:', data.deleted)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F111\u002Frestore', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data.id` | number | Folder identifier |\n| `data.parentId` | number \\| null | Parent folder identifier. `null` — the folder is at the site root |\n| `data.siteId` | number | Site identifier |\n| `data.indexPageId` | number \\| null | Identifier of the folder home page — a page from [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist). `null` when not assigned |\n| `data.active` | boolean | Whether the folder is published |\n| `data.deleted` | boolean | Whether the folder is in the trash |\n| `data.title` | string | Folder name |\n| `data.code` | string | Folder symbolic code — the URL segment of its pages |\n| `data.createdById` | number \\| null | Identifier of the user who created the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.modifiedById` | number \\| null | Identifier of the user who last modified the folder |\n| `data.dateCreate` | string \\| null | Creation date in ISO 8601 without a time zone, in the Bitrix24 account's local time, e.g. `2026-10-16T11:44:24` |\n| `data.dateModify` | string \\| null | Last modification date in the same format |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 111,\n    \"parentId\": 109,\n    \"siteId\": 109,\n    \"indexPageId\": null,\n    \"active\": false,\n    \"deleted\": false,\n    \"title\": \"Docs test sneakers\",\n    \"code\": \"sneakers\",\n    \"createdById\": 1317,\n    \"modifiedById\": 1317,\n    \"dateCreate\": \"2026-10-16T11:44:38\",\n    \"dateModify\": \"2026-10-16T11:45:29\"\n  }\n}\n```\n\n## Error response example\n\n404 — folder not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Folder not found in this site or not visible\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `id` or `folderId` is not a positive integer |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 400 | `INVALID_PARAMS` | A request body was sent. The method accepts an empty body or `{}` |\n| 404 | `ENTITY_NOT_FOUND` | No site with this `id`, the site is not accessible to the key's user, or it belongs to a different `scope` |\n| 404 | `ENTITY_NOT_FOUND` | No folder with this `folderId` on this site, or it is not accessible |\n| 404 | `ENTITY_NOT_FOUND` | The folder was not found after the operation: a concurrent request moved or deleted it |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not confirm the folder operation or rejected it. The reason is in `message` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access: the key's user is not an administrator, or the feature is unavailable on the Bitrix24 account |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The API key is read-only |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **The folder's pages come back unpublished.** Publish the ones you need again with [`POST \u002Fv1\u002Fpages\u002F:id\u002Fpublication`](\u002Fdocs\u002Fentities\u002Fpages). The folder's own `active` flag keeps the value it had before the folder was moved to the trash.\n- **While the folder is in the trash, its pages are not visible.** [`GET \u002Fv1\u002Fpages\u002F:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Fget) returns `404` for such a page. Folders in the trash are returned by [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders?deleted=true`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist).\n- **Restoring a folder that is not in the trash succeeds.** The response is `200` and the folder does not change.\n\n## See also\n\n- [Move a folder to the trash](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Ftrash)\n- [List site folders](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist)\n- [Publish folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Fpublication)\n","## Publish a folder\n\n`POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Fpublication`\n\nPublishes the folder together with all of its parent folders.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Site ID — a positive integer. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `folderId` (path) | number | yes | ID of a folder on this site. List: [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned |\n\nThe request body is empty or `{}`. Any field in the body is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\u002F119\u002Fpublication\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\u002F119\u002Fpublication\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\u002F119\u002Fpublication', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log('Published:', data.active)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Ffolders\u002F119\u002Fpublication', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data.id` | number | Folder ID |\n| `data.parentId` | number \\| null | Parent folder ID. `null` — the folder is in the site root |\n| `data.siteId` | number | Site ID. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `data.indexPageId` | number \\| null | ID of the folder's index page — a page from [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist). `null` if not assigned |\n| `data.active` | boolean | Whether the folder is published |\n| `data.deleted` | boolean | Whether the folder is in the trash |\n| `data.title` | string | Folder name |\n| `data.code` | string | Folder code — the URL segment of its pages |\n| `data.createdById` | number \\| null | ID of the user who created the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.modifiedById` | number \\| null | ID of the user who last modified the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.dateCreate` | string \\| null | Creation date in ISO 8601 format without a time zone: Bitrix24 account time, `2026-10-16T15:49:53` |\n| `data.dateModify` | string \\| null | Last modification date in the same format |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 119,\n    \"parentId\": 117,\n    \"siteId\": 233,\n    \"indexPageId\": null,\n    \"active\": true,\n    \"deleted\": false,\n    \"title\": \"Docs test sneakers\",\n    \"code\": \"sneakers\",\n    \"createdById\": 1317,\n    \"modifiedById\": 1317,\n    \"dateCreate\": \"2026-10-16T15:49:53\",\n    \"dateModify\": \"2026-10-16T15:50:13\"\n  }\n}\n```\n\n## Error response example\n\n404 — folder not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Folder not found in this site or not visible\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `id` or `folderId` is not a positive integer |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 400 | `INVALID_PARAMS` | A request body was passed. The method accepts an empty body or `{}` |\n| 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` |\n| 404 | `ENTITY_NOT_FOUND` | No folder with this `folderId` exists on this site, or it is not accessible |\n| 404 | `ENTITY_NOT_FOUND` | The folder was not found after the operation — a concurrent request moved or deleted it |\n| 422 | `BITRIX_ERROR` | One of the parent folders is in the trash and the folder itself is not published. The `message` text comes from Bitrix24 verbatim |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not confirm the folder operation or rejected it. The reason is in `message` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access: the key's user has no permission to publish the site and no administrator rights, or the feature is unavailable on the Bitrix24 account |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The API key is read-only |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header was not passed |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **The site is not published.** The site's `active` flag in [`GET \u002Fv1\u002Fsites\u002F:id`](\u002Fdocs\u002Fentities\u002Fsites\u002Fget) does not change. To publish the site, use [`POST \u002Fv1\u002Fsites\u002F:id\u002Fpublication`](\u002Fdocs\u002Fentities\u002Fsites\u002Fpublication).\n- **A folder in the trash is published too.** The response is `200` with `active: true`, while `deleted` stays `true`. To return the folder from the trash, use [`POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Frestore`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Frestore).\n- **Republishing succeeds without an error.** For an already published folder the response is `200`, and the folder does not change.\n\n## See also\n\n- [Unpublish a folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Funpublish)\n- [List folders](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist)\n- [Move a folder to the trash](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Ftrash)\n","## Unpublish folder\n\n`POST \u002Fv1\u002Fsites\u002F:id\u002Ffolders\u002F:folderId\u002Funpublish`\n\nUnpublishes a folder together with all of its parent folders.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Site identifier — a positive integer. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `folderId` (path) | number | yes | Identifier of a folder on this site. List: [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned |\n\nThe request body is empty or `{}`. Any field in the body is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F111\u002Funpublish\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F111\u002Funpublish\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F111\u002Funpublish', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log('Published:', data.active)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F109\u002Ffolders\u002F111\u002Funpublish', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data.id` | number | Folder identifier |\n| `data.parentId` | number \\| null | Parent folder identifier. `null` — the folder is at the site root |\n| `data.siteId` | number | Site identifier |\n| `data.indexPageId` | number \\| null | Identifier of the folder home page — a page from [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist). `null` when not assigned |\n| `data.active` | boolean | Whether the folder is published |\n| `data.deleted` | boolean | Whether the folder is in the trash |\n| `data.title` | string | Folder name |\n| `data.code` | string | Folder symbolic code — the URL segment of its pages |\n| `data.createdById` | number \\| null | Identifier of the user who created the folder. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `data.modifiedById` | number \\| null | Identifier of the user who last modified the folder |\n| `data.dateCreate` | string \\| null | Creation date in ISO 8601 without a time zone, in the Bitrix24 account's local time, e.g. `2026-10-16T11:44:24` |\n| `data.dateModify` | string \\| null | Last modification date in the same format |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 111,\n    \"parentId\": 109,\n    \"siteId\": 109,\n    \"indexPageId\": null,\n    \"active\": false,\n    \"deleted\": false,\n    \"title\": \"Docs test sneakers\",\n    \"code\": \"sneakers\",\n    \"createdById\": 1317,\n    \"modifiedById\": 1317,\n    \"dateCreate\": \"2026-10-16T11:44:38\",\n    \"dateModify\": \"2026-10-16T11:45:44\"\n  }\n}\n```\n\n## Error response example\n\n404 — folder not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Folder not found in this site or not visible\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `id` or `folderId` is not a positive integer |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 400 | `INVALID_PARAMS` | A request body was sent. The method accepts an empty body or `{}` |\n| 404 | `ENTITY_NOT_FOUND` | No site with this `id`, the site is not accessible to the key's user, or it belongs to a different `scope` |\n| 404 | `ENTITY_NOT_FOUND` | No folder with this `folderId` on this site, or it is not accessible |\n| 404 | `ENTITY_NOT_FOUND` | The folder was not found after the operation: a concurrent request moved or deleted it |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not confirm the folder operation or rejected it. The reason is in `message` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access: the key's user is not an administrator, or the feature is unavailable on the Bitrix24 account |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The API key is read-only |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n\nThe full list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **Parent folders are unpublished along with this one.** After a nested folder is unpublished, every folder above it up to the site root also gets `active: false`.\n- **Nested folders are not affected.** Unpublishing a parent folder leaves the folders nested in it published.\n- **Unpublishing again succeeds.** For a folder that is already unpublished, the response is `200` and the folder does not change.\n\n## See also\n\n- [Publish folder](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Fpublication)\n- [List site folders](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist)\n- [Move a folder to the trash](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Ftrash)\n",1795415299153]