[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-chats\u002Fmanagement\u002Fpermissions-users-delete":3,"docs-tabs-chats\u002Fmanagement\u002Fpermissions-users-delete":6},{"content":4,"lastmod":5},"## Set the permission to remove members\n\n`PUT \u002Fv1\u002Fchats\u002F:dialogId\u002Fpermissions\u002Fusers-delete`\n\nSets who in a chat can remove members: all members, managers and the owner, or the owner only.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `dialogId` (path) | string | yes | Dialog ID: `chatXXX` for a group chat, a numeric user ID for private messages, `me` — the current user's personal dialog. A CRM entity chat is found via [Find a CRM entity chat](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Ffind) |\n\nThe operation takes no query parameters: any parameter in the query string is refused with `400 INVALID_PARAMS`.\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `rightsLevel` | string | yes | Who holds the permission: `MEMBER` — all members, `MANAGER` — managers and the owner, `OWNER` — the owner only. Case does not matter: `manager` and `MANAGER` are equivalent |\n\nOther body fields are refused with `400 INVALID_PARAMS`, and the message names the extra field.\n\nRight after a group chat is [created](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fcreate), the permission value is `MANAGER`.\n\n## Examples\n\nThe examples let only the owner remove members.\n\n### curl — personal key\n\n```bash\ncurl -X PUT https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat2741\u002Fpermissions\u002Fusers-delete \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"rightsLevel\": \"OWNER\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X PUT https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat2741\u002Fpermissions\u002Fusers-delete \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"rightsLevel\": \"OWNER\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat2741\u002Fpermissions\u002Fusers-delete', {\n  method: 'PUT',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ rightsLevel: 'OWNER' }),\n})\n\nconst { success } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fchats\u002Fchat2741\u002Fpermissions\u002Fusers-delete', {\n  method: 'PUT',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ rightsLevel: 'OWNER' }),\n})\n\nconst { success } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | boolean | `true` — the permission is saved |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": true\n}\n```\n\n## Error response example\n\n400 — the request sets `rightsLevel` to `\"NONE\"`, a value outside the operation's set:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Body field `rightsLevel` must be one of MANAGER, MEMBER, OWNER (any case).\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | The body has no `rightsLevel`, or the value is not in the operation's set: `MEMBER`, `MANAGER`, `OWNER`. The message lists the allowed values |\n| 400 | `INVALID_PARAMS` | The body has a field other than `rightsLevel` |\n| 400 | `INVALID_PARAMS` | The request body is not a JSON object |\n| 400 | `INVALID_PARAMS` | The query string has a parameter |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 refused: the user is not a chat member, or the `settings` permission does not let them change permissions |\n| 422 | `BITRIX_ERROR` | Bitrix24 returned an error, and the Bitrix24 code is in `error.b24Code`. A missing chat gives `CHAT_NOT_FOUND` |\n| 403 | `SCOPE_DENIED` | The API key lacks the `im` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only — changing permissions counts as a write |\n| 401 | `TOKEN_MISSING` | The API key has no configured Bitrix24 tokens |\n| 502 | `ME_ALIAS_RESOLUTION_FAILED` | `dialogId=me` — the current user's ID could not be resolved |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a server error |\n\nAll `400` refusals happen before the Bitrix24 call.\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Current value.** The `permissions.manageUsersDelete` field of the [Dialog details](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fget) response returns the permission in lower case, for example `owner`.\n\n## See also\n\n- [Set the permission to post messages](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fpermissions-messages)\n- [Set the permission to invite guests](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fpermissions-guest-invites)\n- [Set the permission to change chat settings](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fpermissions-settings)\n- [Set the permission to change chat appearance](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fpermissions-ui)\n- [Set the permission to add members](\u002Fdocs\u002Fchats\u002Fmanagement\u002Fpermissions-users-add)\n- [Members](\u002Fdocs\u002Fchats\u002Fmembers)\n- [Dialog details](\u002Fdocs\u002Fchats\u002Fdiscovery\u002Fget)\n","2026-10-05",{},1795415430248]