channels_connect_session_get
Where a connect session stands. Poll every 2-3 seconds.
Returns {status, qr, qr_expires_at, expires_at, pairing_code, account_id, phone, name, external_ref, error}. qr is always the current code: draw whatever the latest answer carries and keep nothing. A value that starts with data: is a picture to show as it is (Viber); anything else is a string to draw. qr_expires_at is null when the channel does not say (WhatsApp, Viber).
After the number is connected the session keeps answering connected with account_id, phone and name for 15 minutes. A session of another workspace or key is not found.
Statuses: waiting_scan: show qr (it changes; always draw the one from the latest get; null means the code is not ready yet, keep polling). need_phone: submit the phone number. need_code: submit the code Telegram sent. need_password: submit the Telegram two-step verification password. need_pairing_code: show pairing_code; the person types it in WhatsApp > Linked devices > Link with phone number. connected: account_id, phone, name are set. expired: start a new session. error: error says why.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"session_id": "<session_id>"
},
"name": "channels_connect_session_get"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | The session_id that channels.connect_session.start returned. | |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. |