[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fsites\u002Fgroup-binding\u002Fbind":3,"docs-tabs-entities\u002Fsites\u002Fgroup-binding\u002Fbind":6},{"content":4,"lastmod":5},"## Bind a knowledge base to a workgroup\n\n`POST \u002Fv1\u002Fsites\u002F:id\u002Fgroup-binding`\n\nBinds a knowledge base site to a Bitrix24 workgroup, making the site that group's knowledge base.\n\nFor how a binding changes the site type and how to read the pages of a bound site, see [Knowledge base bindings to a workgroup](\u002Fdocs\u002Fentities\u002Fsites\u002Fgroup-binding).\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Knowledge base site ID. List: `GET \u002Fv1\u002Fsites?scope=KNOWLEDGE` |\n| `scope` (query) | string | no | Site scope: `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| `groupId` | number | yes | Workgroup ID. List: `GET \u002Fv1\u002Fworkgroups` |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F235\u002Fgroup-binding\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"groupId\": 171}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F235\u002Fgroup-binding\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"groupId\": 171}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F235\u002Fgroup-binding', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ groupId: 171 }),\n})\n\nconst { data } = await res.json()\nconsole.log(data.type, data.bindings)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F235\u002Fgroup-binding', {\n  method: 'POST',\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({ groupId: 171 }),\n})\n\nconst { data } = await res.json()\nconsole.log(data.type, data.bindings)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | The site and its bindings to the group, re-read after the operation |\n| `data.id` | number | Site ID |\n| `data.title` | string | Site title |\n| `data.type` | string | Site type after binding — `GROUP` |\n| `data.active` | boolean | Whether the site is published |\n| `data.deleted` | boolean | Whether the site is in the trash |\n| `data.bindings` | array | The site's bindings to the workgroup passed in `groupId`, re-read after the operation |\n| `data.bindings[].siteId` | number | Site ID |\n| `data.bindings[].groupId` | number | Workgroup ID |\n| `data.bindings[].title` | string | Knowledge base title. An empty string if no title was returned |\n| `data.bindings[].publicUrl` | string | Knowledge base URL inside the group. An empty string if no URL was returned |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 235,\n    \"title\": \"VIBE-PROBE\",\n    \"type\": \"GROUP\",\n    \"active\": false,\n    \"deleted\": false,\n    \"bindings\": [\n      {\n        \"siteId\": 235,\n        \"groupId\": 171,\n        \"title\": \"VIBE-PROBE\",\n        \"publicUrl\": \"https:\u002F\u002Fexample.bitrix24.com\u002Fknowledge\u002Fgroup\u002Fvibe-probe-bind\u002F\"\n      }\n    ]\n  }\n}\n```\n\n## Error response example\n\n404 — site not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Site not found or not visible\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `MISSING_REQUIRED_FIELDS` | The body has no `groupId` field or is not an object |\n| 400 | `INVALID_PARAMS` | The body has fields other than `groupId` — message `Only groupId is accepted` |\n| 400 | `INVALID_PARAMS` | `groupId` is not a positive integer |\n| 400 | `INVALID_PARAMS` | `id` in the path is not a positive integer |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 404 | `ENTITY_NOT_FOUND` | No site with this `id` among knowledge bases, group sites or sites in the requested `scope` — message `Site not found or not visible` |\n| 404 | `ENTITY_NOT_FOUND` | The binding was created, but the site was not found on re-read — message `Site is no longer visible after the binding action` |\n| 409 | `SITE_BINDING_TYPE_MISMATCH` | The site type is neither `KNOWLEDGE` nor `GROUP` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on this Bitrix24 account. Ask a Bitrix24 account administrator to enable it — until then a retry returns the same refusal |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused the binding: the site is not writable, the user has no permissions on the group, the group already has a knowledge base, or the site is already bound to this group |\n| 422 | `BITRIX_ERROR` | The binding was made, but Bitrix24 returned the list of bindings in an unexpected format |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access to the key owner |\n| 403 | `B24_TARIFF_RESTRICTION` | The Bitrix24 account's plan does not allow the call |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only. The request is refused before any call to the Bitrix24 account |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 429 | `RATE_LIMITED` | Bitrix24 throttled requests to the Bitrix24 account. Retry after the delay from the `Retry-After` header |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 responded with a server error or the connection dropped before a complete response. The operation may have succeeded — re-read the bindings before retrying |\n| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time. The operation may have succeeded — re-read the bindings before retrying |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Check the list of bindings to find the cause of a `422` refusal.** A `422 BITRIX_ERROR` response does not distinguish a repeated binding from other refusals. The request `GET \u002Fv1\u002Fsites\u002Fgroup-bindings?groupId=171` shows which site the group is already bound to: if your `id` is in the response, the binding already exists and no retry is needed.\n\n## See also\n\n- [Knowledge base bindings to a workgroup](\u002Fdocs\u002Fentities\u002Fsites\u002Fgroup-binding)\n- [List knowledge base bindings to workgroups](\u002Fdocs\u002Fentities\u002Fsites\u002Fgroup-binding\u002Flist)\n- [Unbind a knowledge base from a workgroup](\u002Fdocs\u002Fentities\u002Fsites\u002Fgroup-binding\u002Funbind)\n- [Knowledge base menu bindings](\u002Fdocs\u002Fentities\u002Fsites\u002Fmenu-bindings)\n- [List sites](\u002Fdocs\u002Fentities\u002Fsites\u002Flist)\n- [List workgroups](\u002Fdocs\u002Fentities\u002Fworkgroups\u002Flist)\n- [Errors](\u002Fdocs\u002Ferrors)\n","2026-10-19",{},1795376982520]