For AI agents: markdown of this page — /docs-content-en/entities/crm-document-templates/get.md documentation index — /llms.txt
Get a CRM document template
GET /v1/crm-document-templates/:id
Returns a single CRM document template by ID, together with the record types it is linked to and the employee access codes.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionTemplate ID, a positive integer. List: GET /v1/crm-document-templates |
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/crm-document-templates/87" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/crm-document-templates/87" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-document-templates/87', {
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { success, data } = await res.json()
console.log('Template:', data.name, 'linked to:', data.entityTypeId)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-document-templates/87', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | DescriptionAlways true on success |
Fielddata |
Typeobject | DescriptionThe template |
Fielddata.id |
Typestring | DescriptionTemplate ID |
Fielddata.name |
Typestring | DescriptionName |
Fielddata.region |
Typestring | DescriptionTemplate region, for example uk |
Fielddata.code |
Typestring | null | DescriptionSymbolic code of the template |
Fielddata.active |
Typestring | DescriptionAvailability: Y / N |
Fielddata.moduleId |
Typestring | DescriptionOwner module, always crm in this section |
Fielddata.numeratorId |
Typestring | DescriptionID of the numerator that assigns numbers to documents |
Fielddata.withStamps |
Typestring | DescriptionStamps and signatures: Y / N |
Fielddata.users |
Typeobject | DescriptionAccess codes of the employees who can see the template. The key and the value are identical and equal to the access code, for example {"UA": "UA"} means all employees |
Fielddata.isDeleted |
Typestring | DescriptionWhether the template is marked as deleted: Y / N |
Fielddata.sort |
Typestring | DescriptionSort order in the list |
Fielddata.createTime |
Typestring | DescriptionCreation date in ISO 8601 |
Fielddata.updateTime |
Typestring | DescriptionModification date in ISO 8601 |
Fielddata.entityTypeId |
Typearray | DescriptionCRM record types the template is linked to, as strings: 1 — lead, 3 — contact, 4 — company. Deals are broken down by funnel — 2_category_0, 2_category_1 and so on, see CRM document templates for details. A smart process with funnels is returned as 174_3: the smart process type and the ID of its funnel. Smart process types: GET /v1/smart-processes |
Fielddata.download |
Typestring | DescriptionDownload URL of the template file in the Bitrix24 web interface. To download through the API, use downloadMachine |
Fielddata.downloadMachine |
Typestring | DescriptionLink for downloading the template file through the Vibecode API — GET /v1/crm-document-templates/:id/download |
Response example
{
"success": true,
"data": {
"id": "87",
"name": "Addresses",
"region": "uk",
"code": null,
"download": "https://example.bitrix24.com/bitrix/services/main/ajax.php?action=crm.documentgenerator.template.download&SITE_ID=s1&id=87",
"active": "Y",
"moduleId": "crm",
"numeratorId": "1",
"withStamps": "Y",
"users": {
"UA": "UA"
},
"isDeleted": "N",
"sort": "366",
"createTime": "2022-11-23T14:42:12+00:00",
"updateTime": "2023-01-17T11:36:04+00:00",
"entityTypeId": [
"4",
"3",
"2_category_0",
"2_category_1",
"2_category_3",
"174_3",
"177_7",
"177_9",
"185_11",
"1",
"31_5"
],
"downloadMachine": "https://vibecode.bitrix24.com/v1/crm-document-templates/87/download"
}
}
Error response example
404 — template not found:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "CRM template not found."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionThere is no template with this id on the portal |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionA template with this id exists, but its moduleId is not crm, for example an application template. To read application templates, use GET /v1/doc-templates/:id |
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid is not a positive integer |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the request to read the template. The reason is in error.message |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the crm scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no tokens configured |
| HTTP429 | CodeRATE_LIMITED |
DescriptionBitrix24 rate-limited requests to the portal. Retry after the delay in the Retry-After header |
Full list of common API errors — Errors.