[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Factivities\u002Fbindings\u002Fmove":3,"docs-tabs-entities\u002Factivities\u002Fbindings\u002Fmove":6},{"content":4,"lastmod":5},"\n## Move a binding\n\n`POST \u002Fv1\u002Factivities\u002F:activityId\u002Fbindings\u002Fmove`\n\nMoves the activity's binding from one CRM entity to another of the same type: the old binding is removed and the new one is created in a single call.\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| **`sourceEntityTypeId`** | number | yes | Numeric type code of the source entity:\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| **`sourceEntityId`** | number | yes | ID of the source entity |\n| **`targetEntityTypeId`** | number | yes | Numeric type code of the target entity. Must equal `sourceEntityTypeId` |\n| **`targetEntityId`** | number | yes | ID of the target entity |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3631\u002Fbindings\u002Fmove \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"sourceEntityTypeId\": 3, \"sourceEntityId\": 9, \"targetEntityTypeId\": 3, \"targetEntityId\": 17 }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3631\u002Fbindings\u002Fmove \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"sourceEntityTypeId\": 3, \"sourceEntityId\": 9, \"targetEntityTypeId\": 3, \"targetEntityId\": 17 }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Factivities\u002F3631\u002Fbindings\u002Fmove', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    sourceEntityTypeId: 3,\n    sourceEntityId: 9,\n    targetEntityTypeId: 3,\n    targetEntityId: 17,\n  }),\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\u002Fmove', {\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({\n    sourceEntityTypeId: 3,\n    sourceEntityId: 9,\n    targetEntityTypeId: 3,\n    targetEntityId: 17,\n  }),\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.sourceEntityTypeId` | number | Numeric type code of the source entity |\n| `data.sourceEntityId` | number | ID of the source entity |\n| `data.targetEntityTypeId` | number | Numeric type code of the target entity |\n| `data.targetEntityId` | number | ID of the target entity |\n| `data.moved` | 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    \"sourceEntityTypeId\": 3,\n    \"sourceEntityId\": 9,\n    \"targetEntityTypeId\": 3,\n    \"targetEntityId\": 17,\n    \"moved\": true\n  }\n}\n```\n\n## Error response example\n\n422 — source and target entities are of different types:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Source and target entity types are not equal\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `activityId` or any of the `source*` \u002F `target*` fields is not a positive integer |\n| 404 | `ENTITY_NOT_FOUND` | No activity exists for the given `activityId` |\n| 422 | `BITRIX_ERROR` | The source entity type does not match the target entity type |\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**Move works only within one type.** To move an activity to an entity of a different type, `move` does not apply — do it in two steps:\n\n1. Bind the activity to the second entity — [`POST \u002Fv1\u002Factivities\u002F:activityId\u002Fbindings`](\u002Fdocs\u002Fentities\u002Factivities\u002Fbindings\u002Fbind).\n2. Remove the binding from the first — [`DELETE \u002Fv1\u002Factivities\u002F:activityId\u002Fbindings`](\u002Fdocs\u002Fentities\u002Factivities\u002Fbindings\u002Funbind).\n\nThis order does not break the ban on removing the last binding — the activity stays bound to at least one entity the whole time.\n\n## See also\n\n- [Bind](\u002Fdocs\u002Fentities\u002Factivities\u002Fbindings\u002Fbind)\n- [Unbind](\u002Fdocs\u002Fentities\u002Factivities\u002Fbindings\u002Funbind)\n- [List bindings](\u002Fdocs\u002Fentities\u002Factivities\u002Fbindings\u002Flist)\n","2026-10-09",{},1794739303348]