Para agentes de IA: markdown desta página — /docs-content-en/entities/page-templates/list.md índice da documentação — /llms.txt

Os artigos da documentação estão disponíveis atualmente em inglês.

List page templates

GET /v1/page-templates

Returns the templates used to create a site page. Pass the template code when you create a page from a template.

Parameters

Parameter Type Required Default Description
ParametersiteType (query) Typestring Requiredno Defaultpage DescriptionSite type to return templates for: page — landing page, knowledge — knowledge base, group — group knowledge base. An empty or whitespace-only string is rejected with 400 INVALID_PARAMS. A value that matches no template returns an empty array
Parameterscope (query) Typestring Requiredno Default— DescriptionInternal landing scope: KNOWLEDGE — knowledge base, GROUP — group knowledge base, MAINPAGE — main page. Omit it for a regular site

The list is returned in full, without pagination.

Examples

curl — personal key

Terminal
curl -X GET "https://vibecode.bitrix24.com/v1/page-templates?siteType=page" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X GET "https://vibecode.bitrix24.com/v1/page-templates?siteType=page" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/page-templates?siteType=page", {
  method: "GET",
  headers: {"X-Api-Key": "YOUR_API_KEY"},
})
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/page-templates?siteType=page", {
  method: "GET",
  headers: {"X-Api-Key": "YOUR_APP_KEY", "Authorization": "Bearer USER_SESSION_TOKEN"},
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionPage templates
Fielddata[].code Typestring DescriptionTemplate code for the templateCode field when creating a page from a template. A code without / or @ is a standalone template, for example empty — a blank page. A code with / is a page from a set, for example wiki-dark/main. A code with @ is a template from an application, where the part before @ matches appCode
Fielddata[].title Typestring DescriptionTemplate name in the language of the Bitrix24 account
Fielddata[].description Typestring DescriptionTemplate description. An empty string if there is no description
Fielddata[].siteType Typestring DescriptionSite type the template is intended for, in upper case: PAGE, KNOWLEDGE, GROUP. Mirrors the requested siteType
Fielddata[].available Typeboolean DescriptionWhether a page can be created from this template
Fielddata[].appCode Typestring DescriptionCode of the application that added the template. Absent for templates without an application
Fielddata[].previewUrl Typestring DescriptionPreview image URL. Either a full URL with https:// or a scheme-relative URL starting with //. Absent if the template has no preview

Response example

The example shows two templates from the full list:

JSON
{
  "success": true,
  "data": [
    {
      "code": "empty",
      "title": "Blank page",
      "description": "Build your own site from scratch and attract customers!",
      "siteType": "PAGE",
      "available": true,
      "previewUrl": "//example.bitrix24.com/bitrix/components/bitrix/landing.demo/data/page/empty/preview.jpg"
    },
    {
      "code": "requisites/main",
      "title": "Business card site",
      "description": "Find all the information you need about our company",
      "siteType": "PAGE",
      "available": true
    }
  ]
}

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, or omitted."
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionsiteType must be a non-empty string, for example page. — siteType is empty or whitespace-only
HTTP400 CodeINVALID_SCOPE Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE
HTTP422 CodeBITRIX_NO_EFFECT DescriptionBitrix24 did not return page templates. — Bitrix24 did not return the template list
HTTP422 CodeBITRIX_NO_EFFECT DescriptionBitrix24 returned an invalid template descriptor. — the template code in the Bitrix24 response is missing or is not a string
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 is 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, while the key's webhook was issued for the old one. Reissue the key's webhook
HTTP429 CodeRATE_LIMITED DescriptionBitrix24 request limit exceeded. Retry the request in 1-2 seconds
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 did not respond or returned 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.

Known specifics

  • A template code is bound to the site type. A code works only for a site of the type you requested it for in siteType.
  • Unknown query parameters are ignored. A parameter the method does not recognize causes no error and does not change the result.

See also