[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fsites\u002Ffolders\u002Fcreate":3,"docs-tabs-entities\u002Fsites\u002Ffolders\u002Fcreate":6},{"content":4,"lastmod":5},"## 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","2026-10-16",{},1795415299260]