Para agentes de IA: markdown desta página — /docs-content-en/entities/block-repository/favorites/delete.md índice da documentação — /llms.txt

Os artigos da documentação estão disponíveis atualmente em inglês.

Delete a template from "My blocks"

DELETE /v1/block-repository/favorites/:blockId

Deletes 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.

Parameters

Parameter Type Required Description
ParameterblockId (path) Typenumber Requiredyes DescriptionTemplate ID in "My blocks" — the blockId from the response of saving a block. The ID of a regular page block does not work here
Parameterscope (query) Typestring Requiredno DescriptionInternal landing scope: KNOWLEDGE — knowledge base, GROUP — group knowledge base, MAINPAGE — main page. Omit it for a regular site

The request has no body.

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/block-repository/favorites/29417" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/block-repository/favorites/29417" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/block-repository/favorites/29417", {
  method: "DELETE",
  headers: {"X-Api-Key": "YOUR_API_KEY"},
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)

JavaScript — OAuth application

javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/block-repository/favorites/29417", {
  method: "DELETE",
  headers: {"X-Api-Key": "YOUR_APP_KEY", "Authorization": "Bearer USER_SESSION_TOKEN"},
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.deleted Typeboolean DescriptionAlways true: the template is deleted
Fielddata.blockId Typenumber DescriptionID of the deleted template, the same as in the request path

Response example

JSON
{
  "success": true,
  "data": {
    "deleted": true,
    "blockId": 29417
  }
}

Error response example

404 — there is no template with this ID, it is already deleted, or this is the ID of a regular page block:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Page, block or card not found."
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionThere is no template with this blockId: it never existed, is already deleted, or the ID of a regular page block was passed
HTTP400 CodeINVALID_PARAMS DescriptionpageId and blockId must be positive safe integers. — blockId is not a positive integer
HTTP400 CodeINVALID_PARAMS DescriptionBody must be a JSON object. — the body passed is not a JSON object
HTTP400 CodeINVALID_PARAMS DescriptionBody contains an unsupported field. — a body with fields was passed
HTTP400 CodeINVALID_SCOPE Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE
HTTP422 CodeBITRIX_NO_EFFECT DescriptionBitrix24 did not confirm favorite removal. — Bitrix24 did not confirm the template deletion
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the landing scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only; the request is rejected before reaching Bitrix24
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe Bitrix24 user the key is issued for has no permission for this action
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeINVALID_API_KEY DescriptionThe key in X-Api-Key is not found or has been revoked
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP409 CodeLANDING_MODULE_NOT_ENABLED DescriptionThe 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
HTTP409 CodePORTAL_ADDRESS_CHANGED DescriptionThe on-premise Bitrix24 moved to a new address, but the key's webhook was issued for the old one. Reissue the key's webhook
HTTP429 CodeRATE_LIMITED DescriptionThe Bitrix24 request limit is exceeded. Retry the request in 1-2 seconds
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 did not respond or responded with a server error
HTTP503 CodeBITRIX_TIMEOUT DescriptionBitrix24 did not respond in time. Before retrying, check the catalog: the template may already be deleted

Full list of common API errors — Errors.

Known specifics

  • Other users' templates cannot be deleted. Only a template saved by the same Bitrix24 user the key is issued for can be deleted.
  • The source page block remains. Deletion removes the template from the block catalog and does not change the block the template was saved from.

See also