Untuk agen AI: markdown halaman ini — /docs-content-en/entities/pages/move.md indeks dokumentasi — /llms.txt
Artikel dokumentasi saat ini tersedia dalam bahasa Inggris.
Move a page
POST /v1/pages/:id/move
Requires at least one destination field. An empty body returns 400. toFolderId: null explicitly selects the root. Moving unpublishes the page and may republish it if it was active; its address changes.
Requires the landing scope. Write actions refuse a READONLY key.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
id |
integer | yes | Page ID from List pages. |
scope |
string | no | Query: KNOWLEDGE, GROUP or MAINPAGE; omit for an ordinary site. |
toSiteId |
integer | no | Destination from List sites. |
toFolderId |
integer | null | no | folderId of an existing page in the destination site from list pages; null or 0 explicitly selects root. move requires at least one destination field. |
Examples
curl — personal key
curl -X POST "https://vibecode.bitrix24.com/v1/pages/42/move" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"toFolderId": null}'
curl — OAuth application
curl -X POST "https://vibecode.bitrix24.com/v1/pages/42/move" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"toFolderId": null}'
JavaScript — personal key
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/42/move", {
method: "POST",
headers: {"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
body: JSON.stringify({"toFolderId": null}),
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)
JavaScript — OAuth application
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/42/move", {
method: "POST",
headers: {"X-Api-Key": "YOUR_APP_KEY", "Authorization": "Bearer USER_SESSION_TOKEN", "Content-Type": "application/json"},
body: JSON.stringify({"toFolderId": null}),
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | true |
data |
object | Operation result. |
data.id |
integer | Freshly read page ID. |
data.siteId |
integer | Page site. |
data.folderId |
integer | null | Folder; null at root. |
data.title |
string | title |
data.code |
string | Page address code. |
data.active |
boolean | Whether the page is published. |
data.deleted |
string Y/N | Y means in trash; N means not in trash. |
{
"success": true,
"data": {
"id": 42,
"siteId": 10,
"folderId": null,
"title": "Example",
"code": "example",
"active": false,
"deleted": "N"
}
}
Errors
| HTTP | Code | Condition |
|---|---|---|
| 400 | MISSING_REQUIRED_FIELDS |
Required parameters are missing. |
| 400 | INVALID_PAGE_ID |
id is not a positive safe integer. |
| 400 | INVALID_PARAMS |
Invalid body shape or parameter value. |
| 400 | INVALID_SCOPE |
Invalid scope. |
| 401 | TOKEN_MISSING |
No Bitrix24 credentials. |
| 403 | SCOPE_DENIED |
The key lacks landing. |
| 403 | BITRIX_ACCESS_DENIED |
The Bitrix24 user lacks permission. |
| 404 | ENTITY_NOT_FOUND |
Page, destination site or folder not found. |
| 422 | BITRIX_ERROR |
Bitrix24 business refusal; its message is preserved. |
| 422 | BITRIX_NO_EFFECT |
Bitrix24 did not confirm the action or return the expected result. |
| 403 | WRITE_BLOCKED_READONLY_KEY |
A READONLY key cannot write to the portal. |
400 — invalid scope:
{
"success": false,
"error": {
"code": "INVALID_SCOPE",
"message": "scope must be KNOWLEDGE, GROUP or MAINPAGE, or omitted."
}
}