Pogton
Docs Connect links

Getting started

Connect links

Create short-lived signed connect links so your users connect their social accounts over OAuth on your branded page, limit the platforms offered and reconnect accounts.

A connect link is a signed URL to your branded connect page. Your user opens it, picks a platform and signs in with that platform. Pogton stores the tokens and keeps them fresh. You never handle OAuth.

To show your own account picker instead of the hosted page, use headless connect.

Call this from your server, then redirect the user to url or send it to them.

curl -X POST https://pogton.com/api/v1/connect-link \
  -H "Authorization: Bearer pk_3f9a..." \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user_123",
    "platforms": ["linkedin", "instagram"],
    "redirect_url": "https://app.example.com/settings/social",
    "expires_in": 3600
  }'
{
  "url": "https://pogton.com/p/your-org?token=eyJ1c2VyX2lkIjoi...",
  "expires_at": "2026-10-21T10:00:00.000Z",
  "user_id": "user_123",
  "platforms": ["linkedin", "instagram"]
}
FieldTypeRequiredDescription
user_idstringYesYour ID for the user, up to 255 characters. The user is created now if new.
platformsstringNoOnly offer these platforms on the page. Default: every platform enabled for your page.
redirect_urlstringNoWhere to send the user afterwards. HTTPS, or http://localhost for development. Default: the Redirect URL set under Dashboard → Connect → Page.
account_idstringNoReconnect this account. The page offers only its platform. See Reconnecting.
featuresstringNoExtra permissions to ask for. ["inbox"] adds the direct-message permissions (Facebook, Instagram, X) for the inbox.
expires_inintegerNoSeconds until the link expires: 60 to 86400. Default 3600.
metadataobjectNoStored on the user.

The link is signed with the API key that created it. Revoking that key invalidates its links. A link can be opened more than once until it expires, so treat it like a password reset link: send it only to that user.

What the user sees

  1. Your logo and colours, set under Dashboard → Connect → Page.
  2. The platforms you offer. Platforms with several accounts, such as LinkedIn pages or Facebook pages, ask the user which ones to connect.
  3. After connecting, the user goes to the redirect URL with connected=<platform> added, for example https://app.example.com/settings/social?connected=linkedin. Without a redirect URL they return to the connect page.

Bluesky has no OAuth: the page asks for the user's handle and an app password instead. Telegram asks for the token of the user's own bot and the channel to post to, and Mastodon asks for the user's server before sending them there to sign in. You don't need to build anything for these.

After connecting

Pogton sends an account.connected webhook with the new account's ID. Or list the user's accounts:

curl "https://pogton.com/api/v1/accounts?user_id=user_123" \
  -H "Authorization: Bearer pk_3f9a..."

Then publish with those account_ids, or with user_id and platforms. See Publishing.

Reconnecting an account

Tokens stop working when a user changes their password, removes your app's access, or when a platform's token can't be refreshed (LinkedIn tokens last about 60 days). Pogton then sets the account's status to needs_reauth and sends account.needs_reauth. Publishing to it fails with auth_expired until the user reconnects.

To reconnect, create a link with the account's ID:

curl -X POST https://pogton.com/api/v1/connect-link \
  -H "Authorization: Bearer pk_3f9a..." \
  -H "Content-Type: application/json" \
  -d '{ "user_id": "user_123", "account_id": "j97fk2m8q4r1t6v3w8x0y5z2a7b4c9ed" }'

The page offers only that account's platform. When the user signs in again, the same account gets new tokens and goes back to active; its ID doesn't change. Then retry any posts that failed in the meantime.

account_id must belong to user_id; otherwise the API returns 422 account_user_mismatch.

Your own OAuth apps

By default users sign in through Pogton's app for each platform. To show your own app name on the consent screen, add your app's credentials:

curl -X PUT https://pogton.com/api/v1/platform-credentials/linkedin \
  -H "Authorization: Bearer pk_3f9a..." \
  -H "Content-Type: application/json" \
  -d '{ "client_id": "86abc...", "client_secret": "WPL_AP1..." }'
{ "platform": "linkedin", "client_id": "86abc...", "message": "Credentials saved. client_secret is stored encrypted and will not be returned." }

Set the redirect URI in your app to https://pogton.com/api/oauth/<platform>/callback. New connections use your app from then on. Accounts connected through another app keep refreshing through that app; to move them, have the users reconnect.

Setting or deleting credentials needs a live key, since they decide where live users' tokens go. DELETE /api/v1/platform-credentials/{platform} goes back to Pogton's app. Accounts connected through your app can no longer refresh their tokens and must reconnect. Platforms: twitter, linkedin, instagram, facebook, tiktok, youtube, pinterest, threads, google_business, discord. Bluesky, Telegram and Mastodon need no app. For Discord, add https://pogton.com/api/oauth/discord/callback as a redirect in your Discord application's OAuth2 settings.