[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fdocuments\u002Fcrm-delete":3,"docs-tabs-entities\u002Fdocuments\u002Fcrm-delete":6},{"content":4,"lastmod":5},"## Delete a CRM document\n\n`DELETE \u002Fv1\u002Fcrm-documents\u002F:id`\n\nDeletes a document generated for a CRM record. It cannot be restored through the API — generate a new one if needed.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Document ID, a positive integer. Documents of a record: [`GET \u002Fv1\u002Fcrm-documents`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-list) |\n\nThe request has no body.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-documents\u002F1969\" \\\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-documents\u002F1969\" \\\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-documents\u002F1969', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nif (res.status === 204) {\n  console.log('Document deleted')\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-documents\u002F1969', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nif (res.status === 204) {\n  console.log('Document deleted')\n}\n```\n\n## Response\n\nOn successful deletion, the HTTP status `204 No Content` is returned with an empty body. Success is indicated by the status code, not the content.\n\n## Response example\n\n```\nHTTP\u002F1.1 204 No Content\n```\n\n## Error response example\n\n404 — no document with this `id` exists, including when the same `id` is deleted again:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Document 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 `0` or `abc`. Message: `id must be a positive integer` |\n| 404 | `ENTITY_NOT_FOUND` | No document with this `id` exists, or it was already deleted |\n| 403 | `BITRIX_ACCESS_DENIED` | No access to the CRM record the document is attached to, including when the record does not exist. Message: `Access denied` |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is in read-only mode |\n| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `TOKEN_MISSING` | The key has no tokens mapped to it — an OAuth application key was called without a user session |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Documents by CRM record](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-list)\n- [Get a CRM document](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-get)\n- [Create a CRM document](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-create)\n- [Documents](\u002Fdocs\u002Fentities\u002Fdocuments)\n","2026-10-08",{},1794739373777]