The channel is always created in the workspace that owns the API key. A connect session cannot add a channel anywhere else.
How it works
1
Your backend creates a session
Call
POST /v1/connect-sessions with a key that holds channels:manage. You get back a connectUrl.2
Your frontend opens it in a popup
The popup goes straight on to Meta or TikTok to sign in. For
whatsapp_qr it shows a QR code to scan instead.3
The popup reports back and closes
It sends the result to your window with
postMessage, or redirects to your redirectUri when there is no window to notify.4
Your backend confirms
Read
GET /v1/connect-sessions/{id}, or subscribe to the connect_session.completed webhook. The server record is the truth; the browser message is a hint.1. Create a session
Do this on your server — it needs your API key, which must never reach a browser.
Give
origin, redirectUri, or both. Both must use https; plain http is accepted only for localhost, so you can test locally.
2. Open the popup
Open it directly from the click handler. A popup opened after anawait is usually blocked by the browser.
event.origin. Any page can post a message to your window; only one from https://crm.linkiasoft.com with source: 'linkia-connect' is ours.
Without an opener: the redirect
When the popup can’t reach your window it navigates to yourredirectUri with the result in the query string:
3. Confirm on your server
The session stays readable for 24 hours.
If the person simply closes the popup, nothing is sent — the session stays
pending until it expires. Treat a closed popup with no message as “not connected” and let them try again.
Or listen for the webhook
Subscribe an endpoint toconnect_session.completed under Integrations → Webhooks. It fires when a session ends as connected or cancelled:
Things to know
One session, one channel. If the person’s Facebook login covers several Pages, they pick one. Run another session for the next Page. Workspace rules still apply. A session is refused up front with403 if your workspace isn’t enabled for the direct Meta connection for that channel type, and the connection itself fails if the plan’s channel limit is reached. The popup shows the reason to the person.
Reconnecting is the same call. Connecting a number, Page or account that is already a channel in your workspace refreshes it rather than adding a duplicate — channelId is the existing channel’s id.
WhatsApp may finish with a warning. If Meta saves the number but won’t register it for the Cloud API yet, the session still reports connected and the channel shows as needing action in Linkiasoft. Check its connection_status with GET /v1/connect/channels before sending.
WhatsApp by QR code. With whatsapp_qr the popup shows a QR code straight away; the person opens WhatsApp → Settings → Linked devices → Link a device and scans it. A Use phone number tab gives an 8-character pairing code instead, for when the phone is the only screen. The number keeps working in the WhatsApp app as before. This is an unofficial (WhatsApp Web) connection, so it can’t send WhatsApp message templates — use whatsapp when you need them. The plan’s channel limit is checked when you create the session, so a full workspace gets 403 before the popup opens.
Pop-up blockers. Everything happens inside the one popup you open: the provider sign-in loads in that same window and comes back to our page, so no second window is opened. Open the popup from the person’s click (not after an await) so blockers allow it.
