[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-openlines\u002Foperator\u002Ftransfer":3,"docs-tabs-openlines\u002Foperator\u002Ftransfer":6},{"content":4,"lastmod":5},"## Transfer a dialog\n\n`POST \u002Fv1\u002Fopenlines\u002Foperator\u002Ftransfer`\n\nTransfers the current session of an Open Channel chat to another employee or to the channel queue.\n\nThe action runs on behalf of the employee the key belongs to — see [On whose behalf the action runs](\u002Fdocs\u002Fopenlines\u002Foperator#on-whose-behalf-the-action-runs).\n\n## Request fields (body)\n\n| Field | Type | Required | Description |\n|------|-----|:-----:|----------|\n| `chatId` | number \\| string | yes | Open Channel chat identifier, a positive integer. A string is accepted if it consists of digits only and does not start with zero. See [Chat ID](\u002Fdocs\u002Fopenlines\u002Foperator#chat-id) |\n| `userId` | number \\| string | no | ID of the employee the dialog is transferred to. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers\u002Flist) |\n| `queueId` | number \\| string | no | ID of the channel whose queue receives the dialog. List: [`GET \u002Fv1\u002Fopenline-configs`](\u002Fdocs\u002Fopenlines\u002Fconfig\u002Flist) |\n| `transferId` | number \\| string | no | The target as a single value: a `queue\u003Cid>` string targets a channel queue, for example `queue59`. A number or a digit string targets an employee by ID |\n\nPass exactly one of `userId`, `queueId` and `transferId`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fopenlines\u002Foperator\u002Ftransfer \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"chatId\": 5255,\n    \"userId\": 1295\n  }'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fopenlines\u002Foperator\u002Ftransfer \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"chatId\": 5255,\n    \"userId\": 1295\n  }'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fopenlines\u002Foperator\u002Ftransfer', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    chatId: 5255,\n    userId: 1295,\n  }),\n})\n\nconst { success, data, error } = await res.json()\nif (!success) throw new Error(`${error.code}: ${error.message}`)\nconsole.log('Transferred:', data.transferred)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fopenlines\u002Foperator\u002Ftransfer', {\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    chatId: 5255,\n    userId: 1295,\n  }),\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` on a successful transfer |\n| `data.chatId` | number | Chat identifier from the request. A string from the request is returned as a number |\n| `data.transferred` | boolean | Always `true` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"chatId\": 5255,\n    \"transferred\": true\n  }\n}\n```\n\n## Error response example\n\n400 — more than one target passed:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"INVALID_PARAMS\",\n    \"message\": \"Pass exactly one target: userId, queueId or transferId\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_CHAT_ID` | `chatId` is missing, is not a positive integer, is a string with non-digit characters or a leading zero, or is greater than 9007199254740991 |\n| 400 | `INVALID_PARAMS` | No target passed, more than one target passed, or the target value is neither a positive integer nor a `queue\u003Cid>` string |\n| 404 | `ENTITY_NOT_FOUND` | No chat with this `chatId` |\n| 422 | `BITRIX_ERROR` | Bitrix24 refused the transfer. Its code is returned in `error.b24Code`. `OPERATOR_WRONG` with the text `You can not redirect to this operator` is returned in two cases: the target is the employee the call runs as, or there is no chat with this `chatId` |\n| 403 | `BITRIX_ACCESS_DENIED` | The employee the call runs as has no permission for the action |\n| 502 | `OPENLINE_OPERATOR_FAILED` | Bitrix24 neither confirmed the transfer nor returned an error |\n| 403 | `SCOPE_DENIED` | The key has no `imopenlines` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The key is not recognized |\n| 401 | `TOKEN_MISSING` | A personal key has no access to the Bitrix24 portal, or an application key was sent without a session token in `Authorization` |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or the connection to it broke before the response was complete |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **A transfer to an employee keeps the session.** The session identifier stays the same while its operator changes, and the `queueTransfers` counter in the [session list](\u002Fdocs\u002Fopenlines\u002Fsessions\u002Fsearch) increases by one.\n- **A transfer to a queue opens a new session.** After a transfer by `queueId` or by a `transferId` of the form `queue\u003Cid>`, the chat continues in a new session with the status `new` and no operator. Find its identifier in the [session list](\u002Fdocs\u002Fopenlines\u002Fsessions\u002Fsearch) by `chatId`.\n\n## See also\n\n- [Operator actions and my pause](\u002Fdocs\u002Fopenlines\u002Foperator)\n- [Reassignment history](\u002Fdocs\u002Fopenlines\u002Fsessions\u002Ftransfers)\n- [Session search](\u002Fdocs\u002Fopenlines\u002Fsessions\u002Fsearch)\n- [Open Channel configurations](\u002Fdocs\u002Fopenlines\u002Fconfig)\n","2026-10-19",{},1795415490992]