[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Ffiles\u002Fdelete":3,"docs-tabs-entities\u002Ffiles\u002Fdelete":6},{"content":4,"lastmod":5},"## Delete file\n\n`DELETE \u002Fv1\u002Ffiles\u002F:id`\n\nMoves the object to Bitrix24 trash. Use [restore](\u002Fdocs\u002Fentities\u002Ffiles\u002Frestore) to recover it or [purge](\u002Fdocs\u002Fentities\u002Ffiles\u002Fpurge) to delete it permanently.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `id` (path) | number | yes | File ID. A positive integer |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X DELETE \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002F3291\" \\\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\u002Ffiles\u002F3291\" \\\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\u002Ffiles\u002F3291', {\n  method: 'DELETE',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nif (res.status === 204) {\n  console.log('File moved to trash')\n}\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Ffiles\u002F3291', {\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('File moved to trash')\n}\n```\n\n## Response\n\nOn a successful move to trash, the response is HTTP status `204 No Content` with an empty body. The success indicator is the response code, not the body.\n\n## Response example\n\n```\nHTTP\u002F1.1 204 No Content\n```\n\n## Error response example\n\n404 — file not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Could not find entity with id '99999999'.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 404 | `ENTITY_NOT_FOUND` | File with the given ID not found |\n| 403 | `SCOPE_DENIED` | API key lacks the `disk` scope |\n| 401 | `TOKEN_MISSING` | API key has no configured authorization tokens |\n| 401 | `INVALID_API_KEY` | The key is not recognized — no such key exists on the platform |\n\nFull list of common API errors — [Error codes](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\nUse restore to recover the object or purge to delete it permanently.\n\n## See also\n\n- [List files](\u002Fdocs\u002Fentities\u002Ffiles\u002Flist)\n- [Get file](\u002Fdocs\u002Fentities\u002Ffiles\u002Fget)\n- [Rename file](\u002Fdocs\u002Fentities\u002Ffiles\u002Fupdate)\n- [Upload file](\u002Fdocs\u002Fentities\u002Ffiles\u002Fupload)\n\n- [Restore](\u002Fdocs\u002Fentities\u002Ffiles\u002Frestore)\n- [Purge](\u002Fdocs\u002Fentities\u002Ffiles\u002Fpurge)\n","2026-10-07",{},1794739376165]