لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/sites/folders/publication.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
Publish a folder
POST /v1/sites/:id/folders/:folderId/publication
Publishes the folder together with all of its parent folders.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionSite ID — a positive integer. List: GET /v1/sites |
ParameterfolderId (path) |
Typenumber | Requiredyes | DescriptionID of a folder on this site. List: GET /v1/sites/:id/folders |
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 |
The request body is empty or {}. Any field in the body is rejected with 400 INVALID_PARAMS.
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/sites/233/folders/119/publication" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/sites/233/folders/119/publication" \
-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/119/publication', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { success, data } = await res.json()
console.log('Published:', data.active)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/233/folders/119/publication', {
method: 'POST',
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.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 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: Bitrix24 account time, 2026-10-16T15:49:53 |
Fielddata.dateModify |
Typestring | null | DescriptionLast modification date in the same format |
Response example
{
"success": true,
"data": {
"id": 119,
"parentId": 117,
"siteId": 233,
"indexPageId": null,
"active": true,
"deleted": false,
"title": "Docs test sneakers",
"code": "sneakers",
"createdById": 1317,
"modifiedById": 1317,
"dateCreate": "2026-10-16T15:49:53",
"dateModify": "2026-10-16T15:50:13"
}
}
Error response example
404 — folder not found:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Folder not found in this site or not visible"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid or folderId is not a positive integer |
| HTTP400 | CodeINVALID_SCOPE |
Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE |
| HTTP400 | CodeINVALID_PARAMS |
DescriptionA request body was passed. The method accepts an empty body or {} |
| 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 |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo folder with this folderId exists on this site, or it is not accessible |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionThe folder was not found after the operation — a concurrent request moved or deleted it |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionOne of the parent folders is in the trash and the folder itself is not published. The message text comes from Bitrix24 verbatim |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 did not confirm the folder operation or rejected it. The reason is in message |
| 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 |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionBitrix24 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 |
| 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 was not passed |
Full list of common API errors — Errors.
Known specifics
- The site is not published. The site's
activeflag inGET /v1/sites/:iddoes not change. To publish the site, usePOST /v1/sites/:id/publication. - A folder in the trash is published too. The response is
200withactive: true, whiledeletedstaystrue. To return the folder from the trash, usePOST /v1/sites/:id/folders/:folderId/restore. - Republishing succeeds without an error. For an already published folder the response is
200, and the folder does not change.