Connecting accounts

Connect social accounts from your own UI with one endpoint, or send customers a hosted connect link. Channels, reconnects and disconnects.

Siar handles the OAuth round trip, token storage and refresh for every network. There are two ways to start it.

Connect from your own UI

Request an authorization URL for a team and a network, then redirect the user to it.

curl -X POST "https://api.siaran.my/api/v1/social-account/connect" \
  -H "x-api-key: $SIAR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "type": "LINKEDIN",
    "teamId": "TEAM_ID",
    "redirectUrl": "https://yourapp.example/connected"
  }'
# → { "url": "https://www.linkedin.com/oauth/v2/authorization?..." }
# Send your user to that URL. After consent they land back on redirectUrl.

After consent the network sends the user to Siar, Siar stores the tokens, attaches the account to the team and redirects the user to your redirectUrl. Optional fields adjust the flow: serverUrl (Mastodon), instagramConnectionMethod, tiktokForceLogin, forceBrowserOAuth, withBusinessScope and withMessagingScope. See the connect operation.

A hosted link opens a Siar page that lists the networks you choose, runs the consent flow and returns the user to your app. Use it when your customers, not you, own the accounts.

curl -X POST "https://api.siaran.my/api/v1/social-account/create-portal-link" \
  -H "x-api-key: $SIAR_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "teamId": "TEAM_ID",
    "socialAccountTypes": ["INSTAGRAM", "TIKTOK", "YOUTUBE", "LINKEDIN"],
    "redirectUrl": "https://yourapp.example/settings/social",
    "logoUrl": "https://yourapp.example/logo.png",
    "userName": "Acme Bakery",
    "hidePoweredBy": true,
    "language": "en"
  }'
# → { "url": "https://app.<domain>/connect/..." }  — a hosted page your user opens

Useful options: expiresIn (minutes, 5 to 2880), logoUrl and userName to brand the page, language, hidePoweredBy, hideGoBackButton, maxSocialAccountsConnected and showModalOnConnectSuccess. The link is tied to one team and works for as long as expiresIn allows.

How each network connects

NetworkConnectionAccount needed
TikTokOAuth 2.0 in the browserAny TikTok account. Creator details and privacy options are read from TikTok before every post.
YouTubeOAuth 2.0 in the browserA Google account with a YouTube channel. Brand-account channels are picked after sign-in.
InstagramOAuth 2.0 in the browserAn Instagram professional account (business or creator), connected through Facebook Login or Instagram Login.
FacebookOAuth 2.0 in the browserA Facebook Page you manage. Personal profiles cannot be published to through the API.
X (Twitter)OAuth 2.0 in the browserAny X account. X charges for API usage, so X actions draw from a prepaid credit balance.
ThreadsOAuth 2.0 in the browserA Threads profile.
LinkedInOAuth 2.0 in the browserA LinkedIn member profile, or a company page the member administers.
PinterestOAuth 2.0 in the browserA Pinterest account. Pins are created on a board you name in the request.
RedditOAuth 2.0 in the browserA Reddit user account. Each post names its subreddit; subreddit rules and flairs still apply.
MastodonOAuth 2.0 in the browserAn account on any Mastodon server. Pass the server URL when connecting.
DiscordBot install into a server or workspaceA Discord server where the Siar bot is added. Each post names the channel.
SlackOAuth 2.0 in the browserA Slack workspace where the Siar app is installed. Each post names the channel.
BlueskyHandle and app passwordA Bluesky account.
Google Business ProfileOAuth 2.0 in the browserA Google account that manages one or more Business Profile locations. Pick the location after sign-in.
SnapchatOAuth 2.0 in the browserA Snapchat public profile.

Choosing a channel

Some networks connect a person but publish as something they manage: a Facebook Page, a LinkedIn company page, a YouTube brand channel, a Pinterest board owner, a Google Business Profile location, a Discord or Slack channel. After connecting, the account lists its channels. Select one with POST /social-account/set-channel, clear it with unset-channel, and re-read the list from the network with refresh-channels. The hosted page does this step for the user.

Staying connected

Siar refreshes tokens before they expire and checks connections in the background. When a network revokes access, the account is flagged for reconnection and a social-account.updated event fires. You can run a check yourself with POST /social-account/connection-check or refresh profile data with profile-refresh. Reconnect through the same connect flow; posts that failed because of the broken connection can be moved to the new account with the reconnect operations in the post reference.

Disconnecting

DELETE /social-account/disconnect detaches a network from a team. Revoking Siar’s access on the network’s own settings page has the same effect on the next check. See data deletion for what happens to stored data.