لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/site-templates/list.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

List layout templates

GET /v1/site-templates

Returns all layout templates with the code, title and number of areas of each.

Parameters

Parameter Type Required Description
Parameterscope (query) Typestring Requiredno DescriptionInternal landing scope: KNOWLEDGE — knowledge base, GROUP — group knowledge base, MAINPAGE — main page. Omit for a regular site

The 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.

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/site-templates" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/site-templates" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/site-templates', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { data } = await res.json()
for (const template of data) {
  console.log(`${template.code}: ${template.areaCount} areas`)
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/site-templates', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { data } = await res.json()

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionLayout templates
Fielddata[].id Typenumber DescriptionTemplate ID. The same value appears in the tplId field of sites and pages that use this layout
Fielddata[].code Typestring DescriptionPermanent symbolic code of the template, for example header_footer
Fielddata[].title Typestring DescriptionTemplate name in the language of the Bitrix24 account
Fielddata[].areaCount Typenumber DescriptionNumber of layout areas: header, footer, side columns. 0 — a layout without areas
Fielddata[].active Typeboolean DescriptionWhether the template is active
Fielddata[].sort Typenumber DescriptionSort index of the template

The template HTML markup is not included in the response.

Response example

Three templates from the full list:

JSON
{
  "success": true,
  "data": [
    {
      "id": 1,
      "code": "empty",
      "title": "Empty",
      "areaCount": 0,
      "active": true,
      "sort": 100
    },
    {
      "id": 7,
      "code": "header_footer",
      "title": "With header and footer",
      "areaCount": 2,
      "active": true,
      "sort": 400
    },
    {
      "id": 13,
      "code": "header_only",
      "title": "Header only",
      "areaCount": 1,
      "active": true,
      "sort": 350
    }
  ]
}

Error response example

400 — scope is not one of the allowed values:

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

Errors

HTTP Code Description
HTTP400 CodeINVALID_SCOPE Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE
HTTP400 CodeINVALID_PARAMS DescriptionUnsupported query parameter — a query parameter the method does not accept was passed
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 returned invalid templates — Bitrix24 returned the template list in an unexpected shape
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the landing scope
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe Bitrix24 user on whose behalf the key was issued has no access to sites
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeINVALID_API_KEY DescriptionThe key in X-Api-Key was not found or has been revoked
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP409 CodePORTAL_ADDRESS_CHANGED DescriptionThe on-premise Bitrix24 moved to a new address, but the key's webhook was issued for the old one. Reissue the key's webhook
HTTP429 CodeRATE_LIMITED DescriptionBitrix24 request rate limit exceeded. Retry the request in 1-2 seconds
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 did not respond or responded with a server error
HTTP503 CodeBITRIX_TIMEOUT DescriptionBitrix24 did not respond within the allotted time. The read can be retried

Full list of common API errors — Errors.

See also