POST /v1/channels/whatsapp/connect
Kick off the connection flow for a new WhatsApp Business channel from your CLI or backend, without going through the portal.
mode: "embedded_signup"(default) — Meta’s official flow for WhatsApp Business Cloud API. Requires a human to complete the Embedded Signup in a browser. This is whatkeebai whatsapp connectdoes.mode: "qr"— multi-device QR pairing (no browser, no official WABA). The endpoint starts a session and returns an SSEstream_url; the client receives the QR, scans it with WhatsApp mobile, and when done receives theconnectedevent with thechannel_id. This is whatkeebai whatsapp connect --qrdoes. Documented in detail at POST /v1/channels/whatsapp/connect (QR mode).
General flow
Your backend starts the session
POST /v1/channels/whatsapp/connect. Returns session_id + verification_uri.Show the URL to the user
Poll status every 5 seconds
GET /v1/channels/whatsapp/connect/:session_id until status: completed. The session expires in 15 minutes.Start a session
POST /v1/channels/whatsapp/connect
Required scope: channels:connect
Request
| Field | Type | Required | Description |
|---|---|---|---|
mode | "embedded_signup" | "qr" | no | Default embedded_signup. When set to qr, the rest of the fields change — see QR mode. |
pipeline_id | string | no | (embedded_signup only) Id of the pipeline to attach the new channel to. If omitted, the portal uses the default pipeline. |
coexistence_enabled | boolean | no | (embedded_signup only) true if the number is already registered in the traditional WhatsApp Business App and you want coexistence with Cloud API. Default false. |
name | string | no | (qr only) Label for the QR channel. Default "WhatsApp QR". |
Response 201
| Field | Type | Description |
|---|---|---|
session_id | string | Session id. Use it to poll status. |
verification_uri | string | Portal URL the user must open. Auto-triggers the embedded signup modal. |
expires_in | number | Seconds until the session expires (15 minutes). |
poll_interval | number | Suggested seconds between polls. |
Poll status
GET /v1/channels/whatsapp/connect/:session_id
Required scope: channels:connect
Request
Response 200
While the user hasn’t completed signup:| Status | Meaning |
|---|---|
completed | Channel created. It started receiving Meta webhooks immediately. |
expired | 15 minutes elapsed without completing. Start a new session. |
cancelled | The user cancelled from the portal. Start a new one if you want to retry. |
CLI equivalent
Connected channel ch_xxx (phone_number_id: ...).
Operational notes
Cannot run 100% backend
Subscribe to `whatsapp.channel.connected`
Coexistence with WABA Mobile App
coexistence_enabled: true. Meta syncs the history; the portal reflects it when activating.The PAT determines the destination company
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Body
Modo de conexión: embedded_signup (default) abre el flujo de Meta en el portal; qr devuelve un stream SSE para escanear desde la terminal con WhatsApp multi-dispositivo.
embedded_signup, qr Si se especifica, el canal recién creado se asocia automáticamente al pipeline. Sólo aplica al modo embedded_signup.
Activa el modo coexistencia (si el cliente ya tiene la app de WhatsApp Business activa). Sólo aplica al modo embedded_signup.
Etiqueta visible del canal cuando se conecta por QR. Default: "WhatsApp QR".
Response
The response is of type object.