لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/sites/folders/create.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Create folder
POST /v1/sites/:id/folders
Creates a folder on a site. A folder groups pages: its symbolic code becomes a segment of their URL.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionSite identifier — 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 |
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
Fieldtitle |
Typestring | Requiredyes | DescriptionFolder name, a non-empty string |
Fieldcode |
Typestring | Requiredno | DescriptionFolder symbolic code — the URL segment of its pages. If omitted, it is generated from title: Docs test catalog → docstestcatalog |
FieldparentId |
Typenumber | null | Requiredno | DescriptionIdentifier of a parent folder of this site. List: GET /v1/sites/:id/folders. Omitted or null — the folder is created at the site root |
FieldindexPageId |
Typenumber | null | Requiredno | DescriptionIdentifier of the folder home page — a page of the same site. List: GET /v1/pages?filter[siteId]=:id |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/sites/109/folders" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Docs test catalog"}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/sites/109/folders" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title": "Docs test catalog"}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/109/folders', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ title: 'Docs test catalog' }),
})
const { success, data } = await res.json()
console.log('Folder ID:', data.id)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/109/folders', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ title: 'Docs test catalog' }),
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success |
Fielddata.id |
Typenumber | DescriptionFolder identifier |
Fielddata.parentId |
Typenumber | null | DescriptionParent folder identifier. null — the folder is at the site root |
Fielddata.siteId |
Typenumber | DescriptionSite identifier |
Fielddata.indexPageId |
Typenumber | null | DescriptionIdentifier of the folder home page — a page from GET /v1/pages. null when 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 | DescriptionIdentifier of the user who created the folder. List: GET /v1/users |
Fielddata.modifiedById |
Typenumber | null | DescriptionIdentifier of the user who last modified the folder |
Fielddata.dateCreate |
Typestring | null | DescriptionCreation date in ISO 8601 without a time zone, in the Bitrix24 account's local time, e.g. 2026-10-16T11:44:24 |
Fielddata.dateModify |
Typestring | null | DescriptionLast modification date in the same format |
Response example
201 — folder created:
{
"success": true,
"data": {
"id": 109,
"parentId": null,
"siteId": 109,
"indexPageId": null,
"active": false,
"deleted": false,
"title": "Docs test catalog",
"code": "docstestcatalog",
"createdById": 1317,
"modifiedById": 1317,
"dateCreate": "2026-10-16T11:44:24",
"dateModify": "2026-10-16T11:44:24"
}
}
Error response example
400 — the name is missing:
{
"success": false,
"error": {
"code": "MISSING_REQUIRED_FIELDS",
"message": "title is required"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeMISSING_REQUIRED_FIELDS |
DescriptionThe request body is empty or not an object |
| HTTP400 | CodeMISSING_REQUIRED_FIELDS |
Descriptiontitle is missing |
| HTTP400 | CodeREADONLY_FIELD |
DescriptionThe body contains a read-only field: id, siteId, active, deleted, createdById, modifiedById, dateCreate, dateModify |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionThe body contains a field other than title, code, parentId, indexPageId |
| HTTP400 | CodeINVALID_PARAMS |
Descriptiontitle is empty, title or code is not a string, parentId or indexPageId is neither a positive integer nor null |
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid is not a positive integer |
| HTTP400 | CodeINVALID_SCOPE |
Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo site with this id, the site is not accessible to the key's user, or it belongs to a different scope |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionThe created folder is not found when read back |
| HTTP409 | CodeLANDING_MODULE_NOT_ENABLED |
DescriptionThe Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the creation, for example indexPageId points to a page of another site. The reason is in message |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionBitrix24 denied access: the key's user is not an administrator, or the feature is unavailable on the Bitrix24 account |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe API key is read-only |
| 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 |
The full list of common API errors — Errors.
Known specifics
- A new folder is not published. The response has
active: false. Publish it withPOST /v1/sites/:id/folders/:folderId/publication— its parent folders are published along with it.