[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fcrm-document-templates\u002Favailable":3,"docs-tabs-entities\u002Fcrm-document-templates\u002Favailable":6},{"content":4,"lastmod":5},"## Get templates for a CRM record\n\n`GET \u002Fv1\u002Fcrm-document-templates\u002Favailable`\n\nReturns the CRM document templates that can be applied to a specific deal, contact, company or smart process item. The response includes templates bound to the record type and, for a deal, to its funnel.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `entityTypeId` (query) | number | yes | CRM record type: `2` — deal, `3` — contact, `4` — company. Smart process types: [`GET \u002Fv1\u002Fsmart-processes`](\u002Fdocs\u002Fentities\u002Fsmart-processes). A positive integer, passed once |\n| `entityId` (query) | number | yes | ID of a record of the given type, for example a deal from [`GET \u002Fv1\u002Fdeals`](\u002Fdocs\u002Fentities\u002Fdeals\u002Flist), a contact from [`GET \u002Fv1\u002Fcontacts`](\u002Fdocs\u002Fentities\u002Fcontacts\u002Flist), a company from [`GET \u002Fv1\u002Fcompanies`](\u002Fdocs\u002Fentities\u002Fcompanies\u002Flist) or a smart process item from [`GET \u002Fv1\u002Fitems\u002F:entityTypeId`](\u002Fdocs\u002Fentities\u002Fitems\u002Flist). A positive integer, passed once |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-document-templates\u002Favailable?entityTypeId=2&entityId=575\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-document-templates\u002Favailable?entityTypeId=2&entityId=575\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-document-templates\u002Favailable?entityTypeId=2&entityId=575', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log('Templates for the deal:', data.templates.map(t => t.title))\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-document-templates\u002Favailable?entityTypeId=2&entityId=575', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.templates` | array | Templates available for the record. An empty array means no matching templates |\n| `data.templates[].id` | number | Template ID. Full template record: [`GET \u002Fv1\u002Fcrm-document-templates\u002F:id`](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Fget) |\n| `data.templates[].title` | string | Template name |\n| `data.templates[].documentCreationUrl` | string | Relative path to the page that creates a document from this template for this record in the Bitrix24 web interface, without the Bitrix24 account domain |\n| `data.templates[].isWithStamps` | boolean | Whether the document includes stamps and signatures |\n\n## Response example\n\nDeal 575 is in the funnel with ID 1. Three of the four templates are shown.\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"templates\": [\n      {\n        \"id\": 87,\n        \"title\": \"Addresses\",\n        \"documentCreationUrl\": \"\u002Fbitrix\u002Fcomponents\u002Fbitrix\u002Fcrm.document.view\u002Fslider.php?providerClassName=Bitrix%5CCrm%5CIntegration%5CDocumentGenerator%5CDataProvider%5CDeal&value=575&templateId=87\",\n        \"isWithStamps\": true\n      },\n      {\n        \"id\": 249,\n        \"title\": \"Demo product sale\",\n        \"documentCreationUrl\": \"\u002Fbitrix\u002Fcomponents\u002Fbitrix\u002Fcrm.document.view\u002Fslider.php?providerClassName=Bitrix%5CCrm%5CIntegration%5CDocumentGenerator%5CDataProvider%5CDeal&value=575&templateId=249\",\n        \"isWithStamps\": false\n      },\n      {\n        \"id\": 251,\n        \"title\": \"Array format check\",\n        \"documentCreationUrl\": \"\u002Fbitrix\u002Fcomponents\u002Fbitrix\u002Fcrm.document.view\u002Fslider.php?providerClassName=Bitrix%5CCrm%5CIntegration%5CDocumentGenerator%5CDataProvider%5CDeal&value=575&templateId=251\",\n        \"isWithStamps\": false\n      }\n    ]\n  }\n}\n```\n\n## Error response example\n\n404 — no CRM record with this `entityId`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"CRM record not found.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 404 | `ENTITY_NOT_FOUND` | No record with this `entityId` exists for this `entityTypeId`. The record's existence is checked before templates are requested |\n| 400 | `INVALID_PARAMS` | `entityTypeId` or `entityId` is missing, is not a positive integer or is passed more than once |\n| 422 | `BITRIX_ERROR` | Bitrix24 does not support this `entityTypeId`, for example `999`: `error.b24Code` equals `ENTITY_TYPE_NOT_SUPPORTED` |\n| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |\n| 401 | `TOKEN_MISSING` | The key has no configured tokens |\n| 429 | `RATE_LIMITED` | Bitrix24 rate-limited requests to the portal. Retry after the delay in the `Retry-After` header |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Items in this response differ from the template record.** Here `id` is a number and the name is in the `title` field. In the [template list](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Flist) and when [getting a template](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Fget), `id` is a string and the name is in the `name` field. When matching templates from the two responses, cast `id` to the same type.\n\n## See also\n\n- [List CRM document templates](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Flist)\n- [Get a CRM document template](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Fget)\n- [Create a CRM document](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-create)\n- [CRM document templates](\u002Fdocs\u002Fentities\u002Fcrm-document-templates)\n- [Deals](\u002Fdocs\u002Fentities\u002Fdeals)\n- [Smart processes](\u002Fdocs\u002Fentities\u002Fsmart-processes)\n","2026-10-08",{},1795415216216]