Skip to main content
Switched on per partner. GET /api/partner/connect/settings tells you whether it is on for you and which providers you can use.
Your software gives one of your customers a link. They open it, sign in with the social network (or WhatsApp’s own signup), tick the accounts if there is a choice, and the accounts and channels appear in their workspace, ready to publish to and, where the workspace has an inbox, to message from. Nobody logs into the dashboard, and no provider token ever reaches your software or their browser. One endpoint covers every network: publishing profiles, messaging channels, WhatsApp numbers and Telegram bots. All paths are relative to /api/partner, authenticated by your partner key as X-API-KEY, from your backend only.

What you can connect

When the sign-in gives access to just one account, it is connected straight away, with no picker. For publishing providers, provider is the same value the Publishing API returns in an account’s provider field.
Which providers are available depends on how OnlySocial is configured, so ask rather than assume: GET /api/partner/connect/settings returns the list. A provider that is not on it is refused with a 422 and "error_code": "provider_not_supported".

1. Read the settings and register your return URLs

Response
  • entities is true when your customer ticks accounts after signing in.
  • configured is false when OnlySocial is not set up for that provider yet. A link for it fails at the start with provider_not_configured.
  • asks_for names what the hosted page asks your customer for when you did not send it (server for Mastodon, handle, optional, for Bluesky), and what a Telegram call needs (bot_token).
Your customer is sent back to a return URL you registered. Register them once:
Up to 20 HTTPS URLs, no credentials, query strings or fragments. The list is replaced on every PUT. Matching is exact, including the path and any trailing slash. Removing a URL also stops unfinished sessions from completing against it.

2. Check the allowance

A workspace’s plan limits how many publishing accounts it can connect. Ask before you show your customer a Connect button:
Response
  • limit and remaining are null when the plan sets no account limit.
  • providers says, per provider, whether a new account may be added now. WhatsApp numbers and Telegram bots have their own limits, checked when they are stored, so they always read true here.
Creating a connection for a provider whose answer is false is refused at once with a 422 and "error_code": "account_limit_reached", before your customer signs in anywhere. A reconnect never uses a new slot, so it is never refused for the limit.

3. Create a connection

Response
Open connect_url as a top-level navigation in your customer’s browser, not an iframe and not a fetch. Everything after they click Continue is bound to that browser. The session lasts 30 minutes. Optional fields: state comes back to you on the return URL and in the completion events, 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.

4. Read the result

Your customer comes back to your registered URL with connection_id and state. That redirect is a hint, not the answer. Read the authoritative result:
On connected:
  • accounts lists every account connected, in the order the provider listed them. Each has id, uuid, provider, name and username. A WhatsApp number is listed here too.
  • account_id and account are the first of them, for code that reads one.
  • uuid is the {account} in the Publishing API’s GET /accounts/{account}. id is the integer the Publishing API’s post endpoints take in accounts.
  • skipped lists accounts your customer ticked that were not connected, each with name and reason (for example account_limit_reached when the plan had room for fewer).
  • channel_id is the messaging channel, when there is one: a WhatsApp number or Telegram bot always has one; a publishing account has one when the workspace has an inbox and the network supports messaging. It is null otherwise, and that is not an error.
For WhatsApp, connected means the number was stored and subscribed. Whether messages actually flow still depends on Meta account eligibility and messaging rules. POST /api/partner/workspaces/{workspace}/connections/{connection}/cancel cancels an unfinished session. Repeating it is safe, and it never disconnects an account or channel that already connected.

Reconnect

When an account or channel stops working (an expired or revoked sign-in), send your customer a reconnect link: create a connection with its uuid.
  • account_id: a publishing account of that workspace and that provider.
  • channel_id: a messaging channel. A WhatsApp channel is reconnected through WhatsApp’s signup; a channel that belongs to an account (a Page’s Messenger, an Instagram account) reconnects that account, so send that account’s provider.
The account keeps its id, its scheduled posts and its history. Your customer must sign in as the same profile:
  • If they sign in as a different one, nothing is changed and the session fails with reconnection_target_mismatch.
  • For a Page, channel or location, there is no picker on a reconnect. The sign-in must have access to that same Page, channel or location, or the session fails with reconnection_target_mismatch.
  • A target that is not in that workspace, or not that provider’s, is a 422.
  • WhatsApp is the one exception: the number is picked inside Meta’s dialog. If your customer picks a different number, that number is connected, and the session fails with reconnection_target_mismatch and the new channel_id, so you can decide what to do.

When the profile cannot be proven

Some providers give a different user id to each app, so after OnlySocial moves apps a reconnect cannot always prove it is the same profile. By default such a reconnect fails with reconnect_needs_confirmation and nothing is changed. If you know who your customer is, send "allow_unverified": true with the reconnect. The hosted page then shows the account being reconnected and the profile they signed in as, and your customer confirms or refuses. A profile proven to be a different one is still refused.

Telegram

Telegram has no sign-in screen, so there is no link: you collect the bot’s BotFather token in your software and send it.
The answer is a connection that is already connected, with the bot’s channel_id, and meta.webhook_registered / meta.webhook_taken_over. 201 for a new bot, 200 for the same bot again (its channel is refreshed, not duplicated). The token is never stored on the connection or echoed back.
  • 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_page up to 100.
  • GET /api/partner/workspaces/{workspace}/channels/{channel}
Both return the public channel fields only: never channel data or access tokens.

Or subscribe

Rather than polling, subscribe the workspace’s webhooks (with the osk_ key you issued for it) to publishing.account.connection.completed, .failed, .cancelled and .expired. Every connection sends them. See Events. A connection that has a messaging channel (WhatsApp, Telegram, Facebook Pages, Instagram, TikTok, YouTube, LinkedIn pages, Google Business Profile, Threads, Reddit, Mastodon and Bluesky) also sends salesbot.channel.connection.*, with the same connection id, so a subscriber that only listens to messaging events hears about it too. Delivery is at least once. Deduplicate on the envelope’s id.

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_url carries a one-session capability and lasts 30 minutes. Hand it straight to the customer’s browser; do not log it, e-mail it or put it in an analytics event. To invite a customer by e-mail (a reconnect reminder, say), e-mail a link to your own app and create the connection when they arrive.
  • A Telegram bot token is a credential: send it from your server only, and do not keep it once the bot is connected.
  • A connection id is not a secret, but your state should be unguessable if you use it to resume anything on your side.
  • Send allow_unverified only when your own records tie the link to the account’s owner: a confirmed reconnect hands the account’s scheduled posts to the profile that signed in.