لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/sites/my-permissions.md فهرس التوثيق — /llms.txt
مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.
My site permissions
GET /v1/sites/:id/my-permissions
Returns the operations the API key's user can perform on the site. Use it to check permissions before changing, publishing or deleting a site.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
Parameterid (path) |
Typenumber | Requiredyes | DescriptionSite identifier — a positive integer. List: GET /v1/sites |
Parameterscope (query) |
Typestring | Requiredno | DescriptionInternal landing scope: KNOWLEDGE / GROUP / MAINPAGE. Specify it if the site belongs to the corresponding scope. Otherwise 404 ENTITY_NOT_FOUND is returned. An ordinary site requested with scope also returns 404 |
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/sites/3/my-permissions" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/sites/3/my-permissions" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/3/my-permissions', {
headers: {
'X-Api-Key': 'YOUR_API_KEY',
},
})
const { success, data } = await res.json()
console.log('Can publish:', data.operations.includes('public'))
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/3/my-permissions', {
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
},
})
const { success, data } = await res.json()
Response fields
| Field | Type | Description |
|---|---|---|
Fieldsuccess |
Typeboolean | Descriptiontrue on success |
Fielddata.operations |
Typestring[] | DescriptionOperations of the key's user: read — view, edit — edit, sett — change settings, public — publish, delete — delete, denied — access denied. Can be an empty array |
Response example
Permissions of a Bitrix24 account administrator:
{
"success": true,
"data": {
"operations": [
"denied",
"read",
"edit",
"sett",
"public",
"delete"
]
}
}
Error response example
404 — site not found:
{
"success": false,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Site not found or not visible"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| HTTP400 | CodeINVALID_PARAMS |
Descriptionid is not a positive integer |
| HTTP400 | CodeINVALID_SCOPE |
Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE |
| HTTP404 | CodeENTITY_NOT_FOUND |
DescriptionNo site with this id, the site is not accessible to the key's user, or it belongs to a different scope |
| HTTP409 | CodeLANDING_MODULE_NOT_ENABLED |
DescriptionThe Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |
| HTTP422 | CodeBITRIX_ERROR |
DescriptionBitrix24 returned the permissions in a form other than a list of strings, or rejected the request. The reason is in message |
| HTTP403 | CodeBITRIX_ACCESS_DENIED |
DescriptionBitrix24 denied access: the key's user is not an administrator, or the feature is unavailable on the Bitrix24 account |
| HTTP403 | CodeSCOPE_DENIED |
DescriptionThe API key does not have the landing scope |
| HTTP401 | CodeTOKEN_MISSING |
DescriptionThe API key has no configured tokens |
| HTTP401 | CodeMISSING_API_KEY |
DescriptionThe X-Api-Key header is missing |
The full list of common API errors — Errors.
Known specifics
- The method covers only the key's user. Permissions of other employees and groups assigned via
PUT /v1/sites/:id/permissionscannot be read with this method. deniedin the list does not mean this user is blocked. A Bitrix24 account administrator gets all six operations together withdenied. Check for the operation you need —edit,public,delete— rather than for the absence ofdenied.