لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/sites/menu-bindings/unbind.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Unbind a knowledge base from a menu

DELETE /v1/sites/:id/menu-bindings/:menuCode

Removes the binding of a knowledge base site to a Bitrix24 menu by menu code, and that menu changes for all employees of the Bitrix24 account.

Site type restrictions and how removing a binding changes the employees' menu are covered in Knowledge base menu bindings.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionKnowledge base site ID. List: GET /v1/sites?scope=KNOWLEDGE
ParametermenuCode (path) Typestring Requiredyes DescriptionCode of the menu the site is unbound from. Encode the colon as %3A: crm_switcher%3Alead. Site bindings and their codes: GET /v1/sites/menu-bindings
Parameterscope (query) Typestring Requiredno DescriptionSite scope: KNOWLEDGE, GROUP or MAINPAGE. A knowledge base site is found even without the parameter

No request body is sent.

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/sites/235/menu-bindings/crm_switcher%3Alead" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/sites/235/menu-bindings/crm_switcher%3Alead" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const menuCode = encodeURIComponent('crm_switcher:lead')
const res = await fetch(`https://vibecode.bitrix24.com/v1/sites/235/menu-bindings/${menuCode}`, {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log(success && data.length === 0 ? 'Binding removed' : data)

JavaScript — OAuth application

javascript
const menuCode = encodeURIComponent('crm_switcher:lead')
const res = await fetch(`https://vibecode.bitrix24.com/v1/sites/235/menu-bindings/${menuCode}`, {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()
console.log(success && data.length === 0 ? 'Binding removed' : data)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typearray DescriptionBindings of this site to the removed menu code, read back after removal. Empty array after a successful removal
Fielddata[].siteId Typenumber DescriptionSite ID
Fielddata[].menuCode Typestring DescriptionMenu code
Fielddata[].title Typestring DescriptionSite title
Fielddata[].publicUrl Typestring DescriptionPublic URL of the site

Response example

JSON
{
  "success": true,
  "data": []
}

Error response example

404 — site not found:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Site not found or not visible"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionmenuCode in the path is whitespace only
HTTP400 CodeINVALID_PARAMS Descriptionid in the path is not a positive integer
HTTP400 CodeINVALID_PARAMS DescriptionA non-empty body was sent — message DELETE takes no body
HTTP400 CodeINVALID_SCOPE Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo site with this id was found among knowledge bases, workgroup sites and sites of the scope — message Site not found or not visible
HTTP409 CodeSITE_BINDING_TYPE_MISMATCH DescriptionThe site is not a knowledge base: a regular site or a site bound to a workgroup
HTTP409 CodeLANDING_MODULE_NOT_ENABLED DescriptionThe Sites module is unavailable on the portal. Ask the portal administrator to enable it — while the module is off, a retry returns the same rejection
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the removal. A repeated removal of an already removed binding gets the same response. message lists possible causes: the site is unavailable, not a knowledge base, no write permission, no binding exists
HTTP422 CodeBITRIX_ERROR DescriptionThe binding was removed, but Bitrix24 returned the bindings list in an unexpected format
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionBitrix24 denied access to the key owner
HTTP403 CodeB24_TARIFF_RESTRICTION DescriptionThe portal plan does not allow the call
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the landing scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is in read-only mode, the request does not reach Bitrix24
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP429 CodeRATE_LIMITED DescriptionBitrix24 throttled requests to the portal. Retry after the period from the Retry-After header
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 returned a server error or the connection dropped before the full response. The operation may have succeeded — read the bindings back before retrying
HTTP503 CodeBITRIX_TIMEOUT DescriptionBitrix24 did not respond in time. The operation may have succeeded — read the bindings back before retrying

Full list of common API errors — Errors.

Known specifics

A repeated removal is indistinguishable by the response. To find out after a 422 rejection whether the binding has been removed, call GET /v1/sites/menu-bindings?menuCode=crm_switcher%3Alead and check whether the response contains this site.

See also