[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fblock-repository\u002Ffavorites\u002Fdelete":3,"docs-tabs-entities\u002Fblock-repository\u002Ffavorites\u002Fdelete":6},{"content":4,"lastmod":5},"## Delete a template from \"My blocks\"\n\n`DELETE \u002Fv1\u002Fblock-repository\u002Ffavorites\u002F:blockId`\n\nDeletes a template saved to \"My blocks\" in the block catalog. Deletion is irreversible: the template cannot be restored, so save the block again if needed.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `blockId` (path) | number | yes | Template ID in \"My blocks\" — the `blockId` from the response of [saving a block](\u002Fdocs\u002Fentities\u002Fpages\u002Ffavorite). The ID of a regular page block does not work here |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` — knowledge base, `GROUP` — group knowledge base, `MAINPAGE` — main page. Omit it for a regular site |\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\u002Fblock-repository\u002Ffavorites\u002F29417\" \\\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\u002Fblock-repository\u002Ffavorites\u002F29417\" \\\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 response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fblock-repository\u002Ffavorites\u002F29417\", {\n  method: \"DELETE\",\n  headers: {\"X-Api-Key\": \"YOUR_API_KEY\"},\n})\nconst result = await response.json()\nif (!response.ok) throw new Error(result.error.message)\nconsole.log(result.data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fblock-repository\u002Ffavorites\u002F29417\", {\n  method: \"DELETE\",\n  headers: {\"X-Api-Key\": \"YOUR_APP_KEY\", \"Authorization\": \"Bearer USER_SESSION_TOKEN\"},\n})\nconst result = await response.json()\nif (!response.ok) throw new Error(result.error.message)\nconsole.log(result.data)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data.deleted` | boolean | Always `true`: the template is deleted |\n| `data.blockId` | number | ID of the deleted template, the same as in the request path |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"deleted\": true,\n    \"blockId\": 29417\n  }\n}\n```\n\n## Error response example\n\n404 — there is no template with this ID, it is already deleted, or this is the ID of a regular page block:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Page, block or card not found.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 404 | `ENTITY_NOT_FOUND` | There is no template with this `blockId`: it never existed, is already deleted, or the ID of a regular page block was passed |\n| 400 | `INVALID_PARAMS` | `pageId and blockId must be positive safe integers.` — `blockId` is not a positive integer |\n| 400 | `INVALID_PARAMS` | `Body must be a JSON object.` — the body passed is not a JSON object |\n| 400 | `INVALID_PARAMS` | `Body contains an unsupported field.` — a body with fields was passed |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 422 | `BITRIX_NO_EFFECT` | `Bitrix24 did not confirm favorite removal.` — Bitrix24 did not confirm the template deletion |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only; the request is rejected before reaching Bitrix24 |\n| 403 | `BITRIX_ACCESS_DENIED` | The Bitrix24 user the key is issued for has no permission for this action |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The key in `X-Api-Key` is not found or has been revoked |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on the Bitrix24 account. Ask the account administrator to enable it — while the module is off, retrying the request returns the same rejection |\n| 409 | `PORTAL_ADDRESS_CHANGED` | The on-premise Bitrix24 moved to a new address, but the key's webhook was issued for the old one. Reissue the key's webhook |\n| 429 | `RATE_LIMITED` | The Bitrix24 request limit is exceeded. Retry the request in 1-2 seconds |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 did not respond or responded with a server error |\n| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time. Before retrying, check the catalog: the template may already be deleted |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **Other users' templates cannot be deleted.** Only a template saved by the same Bitrix24 user the key is issued for can be deleted.\n- **The source page block remains.** Deletion removes the template from the block catalog and does not change the block the template was saved from.\n\n## See also\n\n- [Save a block to \"My blocks\"](\u002Fdocs\u002Fentities\u002Fpages\u002Ffavorite)\n- [Saved blocks](\u002Fdocs\u002Fentities\u002Fblock-repository)\n- [Block catalog](\u002Fdocs\u002Fentities\u002Fpages\u002Fcatalog)\n","2026-10-16",{},1795415175414]