[{"data":1,"prerenderedAt":10},["ShallowReactive",2],{"docs-entities\u002Fpages\u002Ftemplate-areas":3,"docs-tabs-entities\u002Fpages\u002Ftemplate-areas":6},{"content":4,"lastmod":5},"# Page template areas\n\nBinds other pages to the areas of a page layout — header, footer, sidebar — reads the bindings, changes them one at a time, and removes them all at once. Removing a binding leaves the pages themselves on the site.\n\nBitrix24 API: `landing.template.getLandingRef`, `landing.template.setLandingRef`\nScope: `landing`\n\n## Operations\n\n- [Get page template areas](.\u002Ftemplate-areas-list.md) — `GET \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`\n- [Update page template areas](.\u002Ftemplate-areas-update.md) — `PATCH \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`\n- [Clear page template areas](.\u002Ftemplate-areas-delete.md) — `DELETE \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`\n\n## Key fields\n\nAll three methods return one object — the page's own bindings after the call.\n\n| Field | Description |\n|------|----------|\n| `areas` | Area bindings. The key is the area number as a string, the value is the ID of the page placed in that area. For a page with no bindings of its own, it is an empty object `{}` |\n| area number | Signed integer from `-2147483648` to `2147483647`, including `0`. The response returns it in decimal notation: `007` becomes `7` |\n| page ID | The ID of any page visible to the user, including a page from another site. Page list: [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) |\n\n## Before you start\n\n1. **The page layout is set by the `tplId` field.** Change the layout with [`PATCH \u002Fv1\u002Fpages\u002F:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Fupdate); the number of areas in each layout is listed on the [Layout templates](\u002Fdocs\u002Fentities\u002Fsite-templates) page. On write, the area number is not checked against the layout: any number in the allowed range is accepted.\n2. **A page and a site have separate area sets.** [Site template areas](\u002Fdocs\u002Fentities\u002Fsites\u002Ftemplate-areas) are read and written separately. The page response does not include site areas, and clearing page areas does not touch site areas.\n3. **An update merges with the current set.** `PATCH` changes only the areas you pass; the value `null` removes the binding from a single area. All bindings can be removed only with `DELETE`: an empty `areas` returns `400`.\n4. **Writes are verified by rereading.** After a change, write methods read the areas again and return them. If the change was not saved, the response is `422 BITRIX_ERROR`, not `200`.\n5. **One write at a time.** While a write to a page's areas is in progress, a second write to the same areas through the API returns `409 TEMPLATE_AREAS_BUSY` — retry it later. The lock applies only between API requests: it does not account for edits made in the Bitrix24 interface.\n6. **A page in a separate scope: knowledge base, group, or the `MAINPAGE` scope.** For such a page, pass the `scope` query parameter with the value `KNOWLEDGE`, `GROUP`, or `MAINPAGE` — without it the page is not found and the response is `404`. For a page on a regular site, do not pass `scope`.\n\n## Typical scenario\n\n1. Find the site's pages: [`GET \u002Fv1\u002Fpages?filter[siteId]=:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist).\n2. Give the page a layout with a header and footer: [`PATCH \u002Fv1\u002Fpages\u002F:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Fupdate) with `{\"tplId\": 7}`.\n3. View the current bindings: [`GET \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`](.\u002Ftemplate-areas-list.md).\n4. Place a header page in an area: [`PATCH \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`](.\u002Ftemplate-areas-update.md) with `{\"areas\": {\"1\": 2387}}`.\n5. Publish the page: `POST \u002Fv1\u002Fpages\u002F:id\u002Fpublication`.\n\n## Limits\n\n| Limit | Value |\n|-------|----------|\n| Area number | From `-2147483648` to `2147483647` |\n| Concurrent writes | One per page. A second write at the same time returns `409 TEMPLATE_AREAS_BUSY` |\n| Request rate | General API limits — [Limits and optimization](\u002Fdocs\u002Foptimization) |\n\n## See also\n\n- [Pages](\u002Fdocs\u002Fentities\u002Fpages)\n- [Site template areas](\u002Fdocs\u002Fentities\u002Fsites\u002Ftemplate-areas)\n- [Layout templates](\u002Fdocs\u002Fentities\u002Fsite-templates)\n- [Page system roles](\u002Fdocs\u002Fentities\u002Fpages\u002Fsystem-pages)\n- [Limits and optimization](\u002Fdocs\u002Foptimization)\n","2026-10-15",{"template-areas-list.md":7,"template-areas-update.md":8,"template-areas-delete.md":9},"## Get page template areas\n\n`GET \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`\n\nReturns the page's own layout area bindings: which page is inserted into its header, footer or sidebar. Site areas are not included; a separate method reads them.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `id` (path) | number | yes | Page ID. List: [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) |\n| `scope` (query) | string | no | Internal landing area: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the page's site belongs to the corresponding area. Otherwise `404 ENTITY_NOT_FOUND` is returned. Omit it for an ordinary site |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nfor (const [area, pageId] of Object.entries(data.areas)) {\n  console.log(`Area ${area} → page ${pageId}`)\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data.areas` | object | Area bindings. The key is the area number as a decimal string, the value is a page ID. Get a page: [`GET \u002Fv1\u002Fpages\u002F:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Fget). A page without its own bindings returns an empty object `{}` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"areas\": {\n      \"1\": 2385\n    }\n  }\n}\n```\n\n## Error response example\n\n404 — no page with this ID was found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Entity not found or not visible\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 404 | `ENTITY_NOT_FOUND` | No page with this ID was found, it is not visible to the user, or it belongs to another area: the wrong `scope` was passed |\n| 400 | `INVALID_PARAMS` | `id must be a positive safe integer` — `id` is not a positive integer |\n| 400 | `INVALID_PARAMS` | `Unsupported query parameter` — a query parameter the method does not accept was passed |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — while the module is off, a retry returns the same refusal |\n| 422 | `BITRIX_ERROR` | `Bitrix24 returned invalid template areas` — Bitrix24 returned the areas in an unexpected shape |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **Site areas are not merged into the response.** The response contains only the page's own bindings. A page that was never given its own areas returns an empty object, even when its site has areas. The site bindings are read by [`GET \u002Fv1\u002Fsites\u002F:id\u002Ftemplate-areas`](\u002Fdocs\u002Fentities\u002Fsites\u002Ftemplate-areas-list).\n\n## See also\n\n- [Page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas)\n- [Update page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas-update)\n- [Clear page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas-delete)\n- [Site template areas](\u002Fdocs\u002Fentities\u002Fsites\u002Ftemplate-areas)\n- [Page list](\u002Fdocs\u002Fentities\u002Fpages\u002Flist)\n","## Update page template areas\n\n`PATCH \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`\n\nBinds other pages to areas of the page layout or removes the binding from individual areas. The areas you pass are changed, and the page's other bindings are kept.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `id` (path) | number | yes | Page ID. List: [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the page's site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned. Omit it for an ordinary site |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `areas` | object | yes | Areas to change, at least one. Key — area number: a signed integer from `-2147483648` to `2147483647`, including `0`. Value — ID of the page to place in the area, or `null` to remove the binding from that area. Page list: [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) |\n\nThe body accepts no other fields: an extra field returns `400 INVALID_PARAMS`. To remove the bindings from all areas at once, use [`DELETE \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas-delete).\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"areas\": {\"1\": 2387}}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PATCH \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"areas\": {\"1\": 2387}}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ areas: { 1: 2387 } }),\n})\n\nconst { success, data } = await res.json()\nconsole.log('Page areas:', data.areas)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas', {\n  method: 'PATCH',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ areas: { 1: 2387 } }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\nThe response contains all of the page's bindings after the change, not only the ones you passed.\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data.areas` | object | The page's area bindings. Key — area number as a string in decimal notation, value — page ID. Get a page: [`GET \u002Fv1\u002Fpages\u002F:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Fget). If no bindings remain after the change — an empty object `{}` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"areas\": {\n      \"1\": 2387\n    }\n  }\n}\n```\n\n## Error response example\n\n409 — another write of this page's areas is in progress at the same time:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"TEMPLATE_AREAS_BUSY\",\n    \"message\": \"Another template-area update is in progress; retry\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 409 | `TEMPLATE_AREAS_BUSY` | Another API request is changing this page's areas at the same time. Retry the request once that write completes |\n| 404 | `ENTITY_NOT_FOUND` | `Entity not found or not visible` — the page with this ID is not found, is not accessible to the user, or belongs to a different scope: the wrong `scope` was passed |\n| 404 | `ENTITY_NOT_FOUND` | `Area page not found or not visible` — a page from the `areas` value is not found or is not accessible to the user |\n| 400 | `MISSING_REQUIRED_FIELDS` | The body has no `areas`, or `areas` is an empty object |\n| 400 | `INVALID_PARAMS` | `Area keys must be distinct signed 32-bit integers; page IDs must be positive safe integers; null removes an area` — an area number is not an integer or is out of range, two keys resolve to the same number (`1` and `01`), or a value is neither a page ID nor `null` |\n| 400 | `INVALID_PARAMS` | `id must be a positive safe integer` — `id` is not a positive integer |\n| 400 | `INVALID_PARAMS` | `Unsupported body field` — the body contains a field other than `areas` |\n| 400 | `INVALID_PARAMS` | `Body must be a JSON object` — the body is not a JSON object, for example an array was passed |\n| 400 | `INVALID_PARAMS` | `Unsupported query parameter` — a query parameter the method does not accept was passed |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |\n| 422 | `BITRIX_ERROR` | `Bitrix24 did not save the template areas; settings permission may be missing` — after the write, the page's areas did not match the expected ones. Check whether the user has permission to change the page settings |\n| 422 | `BITRIX_ERROR` | `Bitrix24 did not confirm the template-area change` — Bitrix24 did not confirm the write |\n| 422 | `BITRIX_ERROR` | `Bitrix24 returned invalid template areas` — Bitrix24 returned the areas in an unexpected form |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode. The request is refused before any call to the Bitrix24 account |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **The area number is not checked against the layout.** Any number in the allowed range is accepted, even if the page layout has fewer areas. For the number of areas in each layout, see [Layout templates](\u002Fdocs\u002Fentities\u002Fsite-templates).\n- **Keys come back in decimal notation.** The key `007` becomes `7` in the response, and `+3` becomes `3`.\n- **The page can be from another site.** Any page the user can see can be placed in an area, including one from a different site. One page can occupy several areas.\n\n## See also\n\n- [Page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas)\n- [Get page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas-list)\n- [Clear page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas-delete)\n- [Update site template areas](\u002Fdocs\u002Fentities\u002Fsites\u002Ftemplate-areas-update)\n- [Page list](\u002Fdocs\u002Fentities\u002Fpages\u002Flist)\n","## Clear page template areas\n\n`DELETE \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`\n\nRemoves the page's own bindings from all layout areas in one call. The pages that were placed in the areas stay on the site, and the site's areas do not change.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `id` (path) | number | yes | Page ID. List: [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Specify it if the page's site belongs to the corresponding scope. Otherwise `404 ENTITY_NOT_FOUND` is returned. Omit it for an ordinary site |\n\nNo request body is needed: a body with any field returns `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log('Areas cleared:', success && Object.keys(data.areas).length === 0)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2381\u002Ftemplate-areas', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\nThe method responds with `200` and a body, not `204`: the response carries the page's bindings after clearing.\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data.areas` | object | The page's area bindings after clearing. Always an empty object `{}` on success. For the format of a non-empty object, see [Get page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas-list) |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"areas\": {}\n  }\n}\n```\n\n## Error response example\n\n409 — another write to this page's areas is in progress at the same time:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"TEMPLATE_AREAS_BUSY\",\n    \"message\": \"Another template-area update is in progress; retry\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 409 | `TEMPLATE_AREAS_BUSY` | Another API request is changing this page's areas at the same time. Retry once that write completes |\n| 404 | `ENTITY_NOT_FOUND` | A page with this ID was not found, is not accessible to the user, or belongs to a different scope: the wrong `scope` was passed |\n| 400 | `INVALID_PARAMS` | `id must be a positive safe integer` — `id` is not a positive integer |\n| 400 | `INVALID_PARAMS` | `Unsupported body field` — the body contains a field the method does not accept |\n| 400 | `INVALID_PARAMS` | `Body must be a JSON object` — the body is not a JSON object, for example an array was passed |\n| 400 | `INVALID_PARAMS` | `Unsupported query parameter` — a query parameter the method does not accept was passed |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |\n| 422 | `BITRIX_ERROR` | `Bitrix24 did not save the template areas; settings permission may be missing` — the page still has bindings after clearing. Check whether the user has permission to change page settings |\n| 422 | `BITRIX_ERROR` | `Bitrix24 did not confirm the template-area change` — Bitrix24 did not confirm the write |\n| 422 | `BITRIX_ERROR` | `Bitrix24 returned invalid template areas` — Bitrix24 returned the areas in an unexpected shape |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode. The request is rejected before it reaches the Bitrix24 account |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **Repeated clearing is safe.** A call on a page without bindings responds with `200` and an empty `data.areas`.\n\n## See also\n\n- [Page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas)\n- [Get page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas-list)\n- [Update page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas-update)\n- [Clear site template areas](\u002Fdocs\u002Fentities\u002Fsites\u002Ftemplate-areas-delete)\n",1795415274851]