[{"data":1,"prerenderedAt":8},["ShallowReactive",2],{"docs-entities\u002Fsite-templates":3,"docs-tabs-entities\u002Fsite-templates":6},{"content":4,"lastmod":5},"# Layout templates\n\nLayout templates for sites and pages: sets of areas for the header, footer and side columns around the content. The template ID appears in the `tplId` field of a site or a page that uses this layout.\n\nBitrix24 API: `landing.template.getlist`\nScope: `landing`\n\n## Operations\n\n- [List layout templates](.\u002Fsite-templates\u002Flist.md) — `GET \u002Fv1\u002Fsite-templates`\n\n## Key fields\n\n| Field | Description |\n|------|----------|\n| `id` | Template ID. The same value appears in the `tplId` field of [sites](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) and [pages](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) |\n| `code` | Permanent symbolic code of the template, for example `header_footer` |\n| `title` | Template name in the language of the Bitrix24 account |\n| `areaCount` | Number of layout areas. `0` — a layout without areas |\n| `sort` | Sort index of the template |\n\nAll response fields are described on the [List layout templates](.\u002Fsite-templates\u002Flist.md) page.\n\n## What to know before you start\n\n1. **A layout template is not a page template.** A layout defines only the areas around the content. A ready-made page design with blocks is chosen by code from [page templates](\u002Fdocs\u002Fentities\u002Fpage-templates).\n2. **`0` and `null` in `tplId` are not template IDs.** The list has no template with such an `id`. Pages can have either value, and sites have `0`. Check for both before looking up a template by `tplId`.\n3. **The site layout cannot be changed through the API, but the page layout can.** The site `tplId` field is read-only. The page layout is changed by [`PATCH \u002Fv1\u002Fpages\u002F:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Fupdate) with the `tplId` field.\n4. **Areas are filled by separate methods.** Which page goes into the header, footer or a column is set by [site template areas](\u002Fdocs\u002Fentities\u002Fsites\u002Ftemplate-areas) and [page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas). The `areaCount` value shows how many areas the layout has.\n\n## Typical scenario\n\n1. Get the templates and pick a layout by `areaCount`: [`GET \u002Fv1\u002Fsite-templates`](.\u002Fsite-templates\u002Flist.md).\n2. Assign the layout to a page: [`PATCH \u002Fv1\u002Fpages\u002F:id`](\u002Fdocs\u002Fentities\u002Fpages\u002Fupdate) with `tplId` set to the template `id`.\n3. Put pages into the layout areas: [`PATCH \u002Fv1\u002Fpages\u002F:id\u002Ftemplate-areas`](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas-update).\n\n## Limits\n\n| Limit | Value |\n|-------|----------|\n| Records per call | the full list of templates, without pagination |\n| Rate limit | shared across the Vibecode API — see [Limits and optimization](\u002Fdocs\u002Foptimization) |\n\n## See also\n\n- [Site template areas](\u002Fdocs\u002Fentities\u002Fsites\u002Ftemplate-areas)\n- [Page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas)\n- [Page templates](\u002Fdocs\u002Fentities\u002Fpage-templates)\n- [Sites](\u002Fdocs\u002Fentities\u002Fsites)\n- [Pages](\u002Fdocs\u002Fentities\u002Fpages)\n","2026-10-16",{"site-templates\u002Flist.md":7},"## List layout templates\n\n`GET \u002Fv1\u002Fsite-templates`\n\nReturns all layout templates with the code, title and number of areas of each.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` — knowledge base, `GROUP` — group knowledge base, `MAINPAGE` — main page. Omit for a regular site |\n\nThe method accepts no other query parameters: any extra parameter is rejected with `400 INVALID_PARAMS`. The full list is returned in one response, without pagination. Items are ordered by ascending `id`, not by `sort`: to show templates in sort order, sort the array by `sort` on your side.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsite-templates\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsite-templates\" \\\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\u002Fsite-templates', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { data } = await res.json()\nfor (const template of data) {\n  console.log(`${template.code}: ${template.areaCount} areas`)\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsite-templates', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data` | array | Layout templates |\n| `data[].id` | number | Template ID. The same value appears in the `tplId` field of [sites](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) and [pages](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) that use this layout |\n| `data[].code` | string | Permanent symbolic code of the template, for example `header_footer` |\n| `data[].title` | string | Template name in the language of the Bitrix24 account |\n| `data[].areaCount` | number | Number of layout areas: header, footer, side columns. `0` — a layout without areas |\n| `data[].active` | boolean | Whether the template is active |\n| `data[].sort` | number | Sort index of the template |\n\nThe template HTML markup is not included in the response.\n\n## Response example\n\nThree templates from the full list:\n\n```json\n{\n  \"success\": true,\n  \"data\": [\n    {\n      \"id\": 1,\n      \"code\": \"empty\",\n      \"title\": \"Empty\",\n      \"areaCount\": 0,\n      \"active\": true,\n      \"sort\": 100\n    },\n    {\n      \"id\": 7,\n      \"code\": \"header_footer\",\n      \"title\": \"With header and footer\",\n      \"areaCount\": 2,\n      \"active\": true,\n      \"sort\": 400\n    },\n    {\n      \"id\": 13,\n      \"code\": \"header_only\",\n      \"title\": \"Header only\",\n      \"areaCount\": 1,\n      \"active\": true,\n      \"sort\": 350\n    }\n  ]\n}\n```\n\n## Error response example\n\n400 — `scope` is not one of the allowed values:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_SCOPE\",\n    \"message\": \"scope must be KNOWLEDGE, GROUP or MAINPAGE\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 400 | `INVALID_PARAMS` | `Unsupported query parameter` — a query parameter the method does not accept was passed |\n| 422 | `BITRIX_ERROR` | `Bitrix24 returned invalid templates` — Bitrix24 returned the template list in an unexpected shape |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 403 | `BITRIX_ACCESS_DENIED` | The Bitrix24 user on whose behalf the key was issued has no access to sites |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The key in `X-Api-Key` was not found or has been revoked |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\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` | Bitrix24 request rate limit 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. The read can be retried |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Site template areas](\u002Fdocs\u002Fentities\u002Fsites\u002Ftemplate-areas)\n- [Page template areas](\u002Fdocs\u002Fentities\u002Fpages\u002Ftemplate-areas)\n- [Page templates](\u002Fdocs\u002Fentities\u002Fpage-templates)\n- [List sites](\u002Fdocs\u002Fentities\u002Fsites\u002Flist)\n- [List pages](\u002Fdocs\u002Fentities\u002Fpages\u002Flist)\n",1795527831766]