[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fcrm-document-templates\u002Fdelete":3,"docs-tabs-entities\u002Fcrm-document-templates\u002Fdelete":6},{"content":4,"lastmod":5},"## Delete a CRM document template\n\n`DELETE \u002Fv1\u002Fcrm-document-templates\u002F:id`\n\nDeletes a CRM document template by its ID. A deleted template cannot be restored via the API — create a new one if needed.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Template identifier. List: [`GET \u002Fv1\u002Fcrm-document-templates`](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Flist) |\n\nNo request body is sent.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-document-templates\u002F263\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-document-templates\u002F263\" \\\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\u002F263', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst body = await res.json()\nif (body.success) {\n  console.log('Template deleted')\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-document-templates\u002F263', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst body = await res.json()\nif (body.success) {\n  console.log('Template deleted')\n}\n```\n\n## Response fields\n\nOn successful deletion, HTTP status `200 OK` is returned.\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` — the template is deleted |\n| `data` | null | Deletion result, always `null` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": null\n}\n```\n\n## Error response example\n\n404 — template not found, including when the same `id` is deleted again:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"CRM template not found.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `id` is not a positive integer, for example `abc`. Message: `Template ID must be a positive integer.` |\n| 404 | `ENTITY_NOT_FOUND` | No template with this `id` exists, it has already been deleted, or it does not belong to the CRM module. The template is not deleted. Templates with `moduleId: rest` are deleted by [`DELETE \u002Fv1\u002Fdoc-templates\u002F:id`](\u002Fdocs\u002Fentities\u002Fdoc-templates\u002Fdelete) |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the deletion. The reason is in `error.message` |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only. Deletion requires a key with write access |\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## See also\n\n- [Get a CRM document template](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Fget)\n- [List CRM document templates](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Flist)\n- [Create a CRM document template](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Fcreate)\n- [CRM document templates](\u002Fdocs\u002Fentities\u002Fcrm-document-templates)\n","2026-10-09",{},1795415216574]