For AI agents: markdown of this page — /docs-content-en/entities/doc-templates/list.md documentation index — /llms.txt

List templates

GET /v1/doc-templates

Returns the list of document templates in your Bitrix24 account with support for filtering, field selection, sorting, and pagination.

Parameters

Parameter Type Default Description
filter object — Filter by template fields. Field list — GET /v1/doc-templates/fields.
Filtering syntax. Example: ?filter[active]=Y
select string — Field selection: ?select=id,name,region
sort string — Sorting via the short syntax: ?sort=-sort, the minus means descending
order object — Sort by field: ?order[sort]=asc
limit number 50 Number of records (up to 5000)
offset number 0 Offset for pagination

For limit > 50, Vibecode automatically requests several pages from Bitrix24 on the server side. The maximum is 5000 records per call.

Examples

curl — personal key

Terminal
curl -g "https://vibecode.bitrix24.com/v1/doc-templates?limit=10&filter[active]=Y" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -g "https://vibecode.bitrix24.com/v1/doc-templates?limit=10&filter[active]=Y" \
  -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/doc-templates?limit=10&filter[active]=Y', {
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data, meta } = await res.json()
console.log(`Found ${meta.total} templates`)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/doc-templates?limit=10&filter[active]=Y', {
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data, meta } = await res.json()

Response fields

Field Type Description
success boolean Always true on success
data array Array of templates
data[].id number Template identifier
data[].name string Name
data[].active string Availability: Y / N
data[].code string | null System code of the template
data[].region string Region
data[].sort number Order in the list
data[].createTime string Creation date (ISO 8601)
data[].updateTime string Update date (ISO 8601)
data[].createdBy number Identifier of the employee who created it
data[].updatedBy number | null Identifier of the employee who changed it
data[].moduleId string Source module of the template
data[].fileId number Drive file identifier
data[].bodyType string Document body format
data[].numeratorId number Numerator identifier
data[].withStamps string Stamps and signatures: Y / N
data[].productsTableVariant string Products table variant in the document
data[].isDeleted boolean Whether the template is marked as deleted
data[].isDefault string Default template: Y / N
data[].users array Identifiers of employees who have access to the template
data[].download string Document download URL
data[].downloadMachine string Vibe API URL; requires X-Api-Key with documentgenerator scope
meta.total number Total number of records matching the filter
meta.hasMore boolean Whether there are more records beyond limit

Full template field schema — Template fields.

Response example

JSON
{
  "success": true,
  "data": [
    {
      "id": 209,
      "active": "Y",
      "name": "Contract template",
      "code": null,
      "region": "uk",
      "sort": 500,
      "createTime": "2026-05-12T09:03:38.000Z",
      "updateTime": "2026-05-12T09:03:38.000Z",
      "createdBy": 1,
      "updatedBy": null,
      "moduleId": "rest",
      "fileId": 9175,
      "bodyType": "Bitrix\\DocumentGenerator\\Body\\Docx",
      "numeratorId": 1,
      "withStamps": "N",
      "productsTableVariant": "",
      "isDeleted": false,
      "isDefault": "N",
      "users": ["U1"],
      "download": "/bitrix/services/main/ajax.php?action=documentgenerator.api.template.download&SITE_ID=s1&id=209",
      "downloadMachine": "https://vibecode.bitrix24.com/v1/doc-templates/209/download"
    },
    {
      "id": 211,
      "active": "Y",
      "name": "Invoice template",
      "code": null,
      "region": "uk",
      "sort": 500,
      "createTime": "2026-05-12T09:04:38.000Z",
      "updateTime": "2026-05-12T09:04:38.000Z",
      "createdBy": 1,
      "updatedBy": null,
      "moduleId": "rest",
      "fileId": 5901,
      "bodyType": "Bitrix\\DocumentGenerator\\Body\\Docx",
      "numeratorId": 1,
      "withStamps": "N",
      "productsTableVariant": "",
      "isDeleted": false,
      "isDefault": "N",
      "users": ["U1"],
      "download": "/bitrix/services/main/ajax.php?action=documentgenerator.api.template.download&SITE_ID=s1&id=211",
      "downloadMachine": "https://vibecode.bitrix24.com/v1/doc-templates/211/download"
    }
  ],
  "meta": {
    "total": 2,
    "hasMore": false
  }
}

Error response example

400 — filter by a nonexistent field. The message lists the fields available for filtering:

JSON
{
  "success": false,
  "error": {
    "code": "UNKNOWN_FILTER_FIELD",
    "message": "Unknown filter field 'bogusField' for entity 'doc-templates'. Available: id, name, numeratorId, region, code, moduleId, active, bodyType, withStamps, sort, users, fileId, file, createdBy, updatedBy, isDeleted, createTime, updateTime, download, downloadMachine, providers, isDefault, productsTableVariant"
  }
}

Errors

HTTP Code Description
400 UNKNOWN_FILTER_FIELD Filter by a nonexistent field; the message lists the available fields
403 SCOPE_DENIED The key lacks the documentgenerator scope
401 TOKEN_MISSING The key has no configured tokens
429 RATE_LIMITED Rate limit exceeded: 300 requests per minute per portal, all API keys of the portal share one limit. The exact value arrives in the x-ratelimit-limit header (the cap is divided across replicas). Retry after the delay in the Retry-After header

Full list of common API errors — Errors.

Known specifics

Sorting and pagination happen on the Vibecode side. order, offset, and limit are applied on the Vibecode side: the full set is fetched, sorted, and sliced to the requested window. total and hasMore are computed from the collected set.

Sorting by a nonexistent field. An unknown field name in order does not raise an error — the request succeeds with status 200, and the unknown sort field is skipped.

String sorting is byte-wise. Sorting by string fields (name, region) compares strings byte by byte, with no locale or case awareness, so the order of non-ASCII and mixed-case values may differ from a "human" collation. Numeric (id, sort) and datetime (createTime, updateTime) fields sort correctly. Empty values (null / empty string) always sort to the end.

See also