Untuk ejen AI: markdown halaman ini — /docs-content-en/entities/pages/copy.md indeks dokumentasi — /llms.txt

Artikel dokumentasi kini tersedia dalam bahasa Inggeris.

Copy a page

POST /v1/pages/:id/copy

Copies a page and its blocks, including a trashed source. A copy of an active page may be published immediately, subject to tariff limits. The destination folder is checked before creation.

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.
skipSystem boolean no Do not copy the system-page flag; default false.

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/pages/42/copy" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/pages/42/copy" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

JavaScript — personal key

javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/42/copy", {
  method: "POST",
  headers: {"X-Api-Key": "YOUR_API_KEY", "Content-Type": "application/json"},
  body: JSON.stringify({}),
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)

JavaScript — OAuth application

javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/42/copy", {
  method: "POST",
  headers: {"X-Api-Key": "YOUR_APP_KEY", "Authorization": "Bearer USER_SESSION_TOKEN", "Content-Type": "application/json"},
  body: JSON.stringify({}),
})
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.
JSON
{
  "success": true,
  "data": {
    "id": 42,
    "siteId": 10,
    "folderId": null,
    "title": "Example",
    "code": "example",
    "active": false,
    "deleted": "N"
  }
}

Errors

HTTP Code Condition
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.

All system errors.

400 — invalid scope:

JSON
{
  "success": false,
  "error": {
    "code": "INVALID_SCOPE",
    "message": "scope must be KNOWLEDGE, GROUP or MAINPAGE, or omitted."
  }
}

See also