[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Factivities\u002Fbindings\u002Fbind":3,"docs-tabs-entities\u002Factivities\u002Fbindings\u002Fbind":6},{"content":4,"lastmod":5},"\n## Bind\n\n`POST \u002Fv1\u002Factivities\u002F:activityId\u002Fbindings`\n\nBinds an activity to an additional CRM entity — it appears in that entity's timeline alongside the owner entity.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `activityId` (path) | number | yes | Activity ID. List: `GET \u002Fv1\u002Factivities` |\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|---------|\n| **`entityTypeId`** | number | yes | Numeric CRM entity-type code:\u003Cbr>1 — lead\u003Cbr>2 — deal\u003Cbr>3 — contact\u003Cbr>4 — company\u003Cbr>7 — quote\u003Cbr>31 — invoice\u003Cbr>≥128 — smart-process, its code — in [`GET \u002Fv1\u002Fsmart-processes`](\u002Fdocs\u002Fentities\u002Fsmart-processes\u002Flist) |\n| **`entityId`** | number | yes | ID of the entity to bind to |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3631\u002Fbindings \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"entityTypeId\": 3, \"entityId\": 9 }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3631\u002Fbindings \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"entityTypeId\": 3, \"entityId\": 9 }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3631\u002Fbindings', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({ entityTypeId: 3, entityId: 9 }),\n})\n\nconst { data } = await res.json()\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3631\u002Fbindings', {\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({ entityTypeId: 3, entityId: 9 }),\n})\n\nconst { data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.activityId` | number | Activity ID |\n| `data.entityTypeId` | number | Numeric type code of the bound entity |\n| `data.entityId` | number | ID of the bound entity |\n| `data.bound` | boolean | `true` only if Bitrix24 returned the boolean value `true`. Otherwise `false` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"activityId\": 3631,\n    \"entityTypeId\": 3,\n    \"entityId\": 9,\n    \"bound\": true\n  }\n}\n```\n\n## Error response example\n\n422 — the entity is already bound:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Activity is already bound to this entity\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `activityId`, `entityTypeId` or `entityId` is not a positive integer |\n| 404 | `ENTITY_NOT_FOUND` | No activity exists for the given `activityId` |\n| 422 | `BITRIX_ERROR` | The activity is already bound to this `entityTypeId` + `entityId` pair, or no such entity exists |\n| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key's access mode blocks binding changes |\n| 401 | `TOKEN_MISSING` | The key has no configured tokens |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Binding is not idempotent.** A repeated request for an already-bound pair returns `422`, not `200`. It means \"already bound\", not a failure — there is no need to retry, and no duplicate is added to the list.\n\n## See also\n\n- [Unbind](\u002Fdocs\u002Fentities\u002Factivities\u002Fbindings\u002Funbind)\n- [List bindings](\u002Fdocs\u002Fentities\u002Factivities\u002Fbindings\u002Flist)\n- [Activities](\u002Fdocs\u002Fentities\u002Factivities)\n","2026-10-09",{},1794739303059]