Private beta, and switched on per partner.
GET /api/partner/channel-connect/settings
tells you whether it is on for you./api/partner, authenticated by your partner key as
X-API-KEY, from your backend only.
What you can connect
Which platforms are available depends on how OnlySocial is configured, so ask
rather than assume:
GET /api/partner/channel-connect/settings returns the
list. A platform that is not on it is refused with a 422 and
"error_code": "provider_not_supported".1. Register your return URLs
2. Create a connection
Response
connect_url as a top-level navigation in your customer’s browser —
not an iframe, not a fetch. Everything after they click Continue is bound to
that browser. The session lasts 30 minutes.
For facebook and instagram your customer then picks which Page or account to
connect, on the same hosted page — the status is selecting while it waits for
them. tiktok grants one account, so that step is a single confirmation, and
WhatsApp’s number selection happens inside Meta’s own dialog.
state comes back to you on the return URL and in the completion event, so use
it to match the session to your own customer. Do not put secrets or personal
data in it; at most 500 characters.
Idempotency-Key (1–200 characters) is optional. The same key and the same
request returns the same connection with 200; a different request on that key
is a 409. Only a pending, unexpired session carries a connect_url — use a
new key to start over.
To reconnect an existing channel, pass its uuid as channel_id.
3. Read the result
Your customer comes back to your registered URL withconnection_id and
state. That redirect is a hint, not the answer — read the authoritative
result:
connected means the number was stored and subscribed. Whether messages
actually flow still depends on Meta account eligibility and messaging rules.
POST …/channel-connections/{connection}/cancel cancels an unfinished session.
Repeating it is safe, and it never disconnects a channel that already connected.
Or subscribe
Rather than polling, subscribe the workspace’s webhooks (with theosk_ key you
issued for it) to salesbot.channel.connection.completed, .failed,
.cancelled and .expired. See Events.
Delivery is at least once — deduplicate on the envelope’s id.
Telegram
201 for a new channel, 200 for the same bot again (its channel is refreshed,
not duplicated).
A 422 on bot_token means the token was rejected, or the bot is
OnlySocial’s own bot, or it is already connected to another workspace, or the
plan’s limit is reached.
A 422 on takeover means the bot’s webhook points somewhere else. Connecting
it here stops that from receiving the bot’s messages, so resend with
"takeover": true only if your customer confirms.
Read channels
GET /api/partner/workspaces/{workspace}/channels—per_pageup to 100.GET /api/partner/workspaces/{workspace}/channels/{channel}
Error codes
Provider error bodies are deliberately not exposed. Fix the configuration, or
let your customer retry with a new session.
Keep it safe
- The partner key stays on your server. It can act on every workspace you have provisioned.
connect_urlcarries a one-session capability. Hand it straight to the customer’s browser; do not log it, e-mail it or put it in an analytics event.- A connection id is not a secret, but your
stateshould be unguessable if you use it to resume anything on your side.
