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
Parameterfilter Typeobject Default— DescriptionFilter by template fields. Field list — GET /v1/doc-templates/fields.
Filtering syntax. Example: ?filter[active]=Y
Parameterselect Typestring Default— DescriptionField selection: ?select=id,name,region
Parametersort Typestring Default— DescriptionSorting via the short syntax: ?sort=-sort, the minus means descending
Parameterorder Typeobject Default— DescriptionSort by field: ?order[sort]=asc
Parameterlimit Typenumber Default50 DescriptionNumber of records (up to 5000)
Parameteroffset Typenumber Default0 DescriptionOffset 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
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionArray of templates
Fielddata[].id Typenumber DescriptionTemplate identifier
Fielddata[].name Typestring DescriptionName
Fielddata[].active Typestring DescriptionAvailability: Y / N
Fielddata[].code Typestring | null DescriptionSystem code of the template
Fielddata[].region Typestring DescriptionRegion
Fielddata[].sort Typenumber DescriptionOrder in the list
Fielddata[].createTime Typestring DescriptionCreation date (ISO 8601)
Fielddata[].updateTime Typestring DescriptionUpdate date (ISO 8601)
Fielddata[].createdBy Typenumber DescriptionIdentifier of the employee who created it
Fielddata[].updatedBy Typenumber | null DescriptionIdentifier of the employee who changed it
Fielddata[].moduleId Typestring DescriptionSource module of the template
Fielddata[].fileId Typenumber DescriptionDrive file identifier
Fielddata[].bodyType Typestring DescriptionDocument body format
Fielddata[].numeratorId Typenumber DescriptionNumerator identifier
Fielddata[].withStamps Typestring DescriptionStamps and signatures: Y / N
Fielddata[].productsTableVariant Typestring DescriptionProducts table variant in the document
Fielddata[].isDeleted Typeboolean DescriptionWhether the template is marked as deleted
Fielddata[].isDefault Typestring DescriptionDefault template: Y / N
Fielddata[].users Typearray DescriptionIdentifiers of employees who have access to the template
Fielddata[].download Typestring DescriptionDocument download URL
Fielddata[].downloadMachine Typestring DescriptionVibe API URL; requires X-Api-Key with documentgenerator scope
Fieldmeta.total Typenumber DescriptionTotal number of records matching the filter
Fieldmeta.hasMore Typeboolean DescriptionWhether there are more records beyond limit

For the full template field schema, see 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
HTTP400 CodeUNKNOWN_FILTER_FIELD DescriptionFilter by a nonexistent field; the message lists the available fields
HTTP403 CodeSCOPE_DENIED DescriptionThe key lacks the documentgenerator scope
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no configured tokens
HTTP429 CodeRATE_LIMITED DescriptionRate limit exceeded: 300 requests per minute per portal. All API keys of the portal share one limit. The current limit is returned in the x-ratelimit-limit header. Retry after the delay in the Retry-After header

For the full list of common API errors, see 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