For AI agents: markdown of this page — /docs-content-en/entities/crm-document-templates/delete.md documentation index — /llms.txt
Delete a CRM document template
DELETE /v1/crm-document-templates/:id
Deletes a CRM document template by its ID. A deleted template cannot be restored via the API — create a new one if needed.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionTemplate identifier. List: GET /v1/crm-document-templates |
No request body is sent.
Examples
curl — personal key
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-document-templates/263" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl -X DELETE "https://vibecode.bitrix24.com/v1/crm-document-templates/263" \
-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/263', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const body = await res.json()
if (body.success) {
console.log('Template deleted')
}
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/crm-document-templates/263', {
method: 'DELETE',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const body = await res.json()
if (body.success) {
console.log('Template deleted')
}
Response fields
On successful deletion, HTTP status 200 OK is returned.
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue — the template is deleted |
Fielddata |
Typenull | DescriptionDeletion result, always null |
Response example
{
"success": true,
"data": null
}
Error response example
404 — template not found, including when the same id is deleted again:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "CRM template not found."
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid is not a positive integer, for example abc. Message: Template ID must be a positive integer. |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo 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 /v1/doc-templates/:id |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 rejected the deletion. The reason is in error.message |
| HTTP403 | CodeWRITE_BLOCKED_READONLY_KEY |
DescriptionThe key is read-only. Deletion requires a key with write access |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe key lacks the crm scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe key has no configured tokens |
| 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.