[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fpages\u002Ffrom-template":3,"docs-tabs-entities\u002Fpages\u002Ffrom-template":6},{"content":4,"lastmod":5},"## Create from a template\n\n`POST \u002Fv1\u002Fpages\u002Ffrom-template`\n\nCreates a page on a site from a ready-made template, at the site root or in the specified folder. The site and the destination folder are checked before the page is created.\n\nRequires the `landing` scope.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `scope` (query) | string | no | Site type: `KNOWLEDGE` — knowledge base, `GROUP` — workgroup site, `MAINPAGE` — main page. Omit the parameter for pages of other sites |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `siteId` | number | yes | Site ID. List: [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `templateCode` | string | yes | Template code — the `code` field. List: [`GET \u002Fv1\u002Fpage-templates`](\u002Fdocs\u002Fentities\u002Fpage-templates\u002Flist) |\n| `title` | string | no | Page title. Without the field the page gets the template name, for example \"Empty page\" for the `empty` template |\n| `description` | string | no | Page description |\n| `folderId` | number \\| null | no | ID of a folder on the `siteId` site. List: [`GET \u002Fv1\u002Fsites\u002F:id\u002Ffolders`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist). `null` or `0` — site root |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002Ffrom-template\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"siteId\": 3, \"templateCode\": \"empty\", \"title\": \"Page from a template\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002Ffrom-template\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"siteId\": 3, \"templateCode\": \"empty\", \"title\": \"Page from a template\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002Ffrom-template\", {\n  method: \"POST\",\n  headers: {\"X-Api-Key\": \"YOUR_API_KEY\", \"Content-Type\": \"application\u002Fjson\"},\n  body: JSON.stringify({\"siteId\": 3, \"templateCode\": \"empty\", \"title\": \"Page from a template\"}),\n})\nconst result = await response.json()\nif (!response.ok) throw new Error(result.error.message)\nconsole.log(result.data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002Ffrom-template\", {\n  method: \"POST\",\n  headers: {\"X-Api-Key\": \"YOUR_APP_KEY\", \"Authorization\": \"Bearer USER_SESSION_TOKEN\", \"Content-Type\": \"application\u002Fjson\"},\n  body: JSON.stringify({\"siteId\": 3, \"templateCode\": \"empty\", \"title\": \"Page from a template\"}),\n})\nconst result = await response.json()\nif (!response.ok) throw new Error(result.error.message)\nconsole.log(result.data)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | The created page |\n| `data.id` | number | Page ID |\n| `data.siteId` | number | ID of the page's site |\n| `data.folderId` | number \\| null | Folder ID. `null` — the page is at the site root |\n| `data.title` | string | Page title |\n| `data.code` | string | Page code in the URL |\n| `data.active` | boolean | Whether the page is published |\n| `data.deleted` | string | `Y` — the page is in the trash, `N` — it is not |\n\n## Response example\n\nThe page is created, HTTP status `201 Created`:\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 2431,\n    \"siteId\": 3,\n    \"folderId\": null,\n    \"title\": \"Page from a template\",\n    \"code\": \"page-from-a-template\",\n    \"active\": false,\n    \"deleted\": \"N\"\n  }\n}\n```\n\n## Error response example\n\n404 — no template with this code:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Template not found; read GET \u002Fv1\u002Fpage-templates for templateCode values.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 404 | `ENTITY_NOT_FOUND` | `Template not found; read GET \u002Fv1\u002Fpage-templates for templateCode values.` — template `templateCode` does not exist |\n| 404 | `ENTITY_NOT_FOUND` | `Site not found.` — site `siteId` does not exist |\n| 404 | `ENTITY_NOT_FOUND` | `Folder not found in the destination site.` — the `folderId` folder is not on the `siteId` site |\n| 404 | `ENTITY_NOT_FOUND` | `Page or folder not found.` — Bitrix24 did not find the page or folder during creation |\n| 400 | `MISSING_REQUIRED_FIELDS` | `siteId and templateCode are required; read GET \u002Fv1\u002Fpage-templates for codes.` — `siteId` or `templateCode` is not passed, or `templateCode` is an empty string or not a string |\n| 400 | `INVALID_PARAMS` | `Body must be a JSON object.` — the body is not a JSON object |\n| 400 | `INVALID_PARAMS` | `Body contains a field this operation does not accept.` — the body contains a field that is not in the request fields table |\n| 400 | `INVALID_PARAMS` | `siteId must be a positive safe integer.` — `siteId` is not a positive integer |\n| 400 | `INVALID_PARAMS` | `folderId must be a positive safe integer or null for the root.` — `folderId` is not a positive integer, `null` or `0` |\n| 400 | `INVALID_PARAMS` | `title must be a string.` — `title` is not a string |\n| 400 | `INVALID_PARAMS` | `description must be a string.` — `description` is not a string |\n| 400 | `INVALID_SCOPE` | `scope must be KNOWLEDGE, GROUP or MAINPAGE, or omitted.` — `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 422 | `BITRIX_NO_EFFECT` | `Bitrix24 did not confirm the page action.` — Bitrix24 did not return the ID of the created page |\n| 422 | `BITRIX_NO_EFFECT` | `Bitrix24 did not return the page after the action.` — the created page could not be read |\n| 422 | `BITRIX_NO_EFFECT` | `Bitrix24 did not persist the requested page state.` — the page ended up outside the `siteId` site or outside the `folderId` folder |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the creation. The error text comes from Bitrix24 |\n| 403 | `SCOPE_DENIED` | The API key lacks the `landing` scope |\n| 403 | `BITRIX_ACCESS_DENIED` | The Bitrix24 user on whose behalf the key was issued has no permission to create the page |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode. The request is rejected before it reaches Bitrix24 |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is not passed |\n| 401 | `INVALID_API_KEY` | The key in `X-Api-Key` is not found or has been revoked |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is not available on the Bitrix24 account |\n| 409 | `PORTAL_ADDRESS_CHANGED` | The on-premise Bitrix24 moved to a new address, but the key's webhook was issued for the old one. Reissue the key's webhook |\n| 429 | `RATE_LIMITED` | The Bitrix24 request limit is exceeded. Retry the request in 1-2 seconds |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 did not respond or responded with a server error |\n| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond within the allotted time |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [List page templates](\u002Fdocs\u002Fentities\u002Fpage-templates\u002Flist)\n- [Copy a page](\u002Fdocs\u002Fentities\u002Fpages\u002Fcopy)\n- [List folders](\u002Fdocs\u002Fentities\u002Fsites\u002Ffolders\u002Flist)\n- [Pages](\u002Fdocs\u002Fentities\u002Fpages)\n","2026-10-21",{},1795415273176]