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

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

Reset site permissions

DELETE /v1/sites/:id/permissions

Resets all access permissions assigned to a site in one call. To assign a new set of permissions instead of resetting them, use the method that replaces site permissions.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionSite ID. List: GET /v1/sites
Parameterscope (query) Typestring Requiredno DescriptionSite type: KNOWLEDGE — knowledge base, GROUP — workgroup site, MAINPAGE — home page. Omit the parameter for all other sites

The request takes no body. An empty object {} is accepted; a body with any field is rejected with 400 INVALID_PARAMS.

Examples

curl — personal key

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/sites/42/permissions" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl -X DELETE "https://vibecode.bitrix24.com/v1/sites/42/permissions" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/42/permissions', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})
const body = await res.json()

if (body.success && body.data.updated) {
  console.log('Site permissions reset')
}

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/42/permissions', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})
const body = await res.json()

if (body.success && body.data.updated) {
  console.log('Site permissions reset')
}

Response fields

Field Type Description
Fieldsuccess Typeboolean Descriptiontrue — the reset succeeded
Fielddata.updated Typeboolean DescriptionAlways true: Bitrix24 confirmed the permissions reset

Response example

JSON
{
  "success": true,
  "data": {
    "updated": true
  }
}

Error response example

404 — the site does not exist or is not visible to the key:

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

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionA request body with fields was passed. Error text — DELETE permissions takes no body
HTTP400 CodeINVALID_PARAMS Descriptionid is not a positive integer
HTTP400 CodeINVALID_SCOPE Descriptionscope is not one of KNOWLEDGE, GROUP, MAINPAGE
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo site with this id exists, or it is not visible to the key. A knowledge base, workgroup site or home page requires the scope parameter
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe key does not belong to a Bitrix24 account administrator, or the Bitrix24 plan does not include extended site permissions
HTTP409 CodeLANDING_MODULE_NOT_ENABLED DescriptionThe Sites module is unavailable on the Bitrix24 account
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 did not confirm the permissions reset or rejected the site operation
HTTP403 CodeSCOPE_DENIED DescriptionThe key lacks the landing scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no Bitrix24 tokens configured

Full list of common API errors — Errors.

Known specifics

  • The reset result cannot be verified through the API. No method reads assigned site permissions. GET /v1/sites/:id/my-permissions shows only the current user's operations: for a Bitrix24 account administrator the list is the same before and after the reset.

See also