Accounts and connecting

An account (a channel) is one connected profile, page, channel or bot. Postkea runs the OAuth apps and keeps tokens fresh, so you only send people to a link and wait for the account to appear.

How each network connects

Most networks use OAuth. A few connect with a token or webhook URL that the person pastes once. GET /v1/platforms returns the same information, including whether this server has the network's app keys configured.

PlatformHow it connectsCredential fields
X xOAuthNone
Instagram instagramOAuthNone
Facebook facebookOAuthNone
Threads threadsOAuthNone
TikTok tiktokOAuthNone
YouTube youtubeOAuthNone
LinkedIn linkedinOAuthNone
Pinterest pinterestOAuthNone
Bluesky blueskyCredentialshandleappPasswordservice
Mastodon mastodonOAuth or credentialsinstanceaccessToken
Google Business googlebusinessOAuthNone
Reddit redditOAuthNone
Telegram telegramCredentialsbotTokenchatId
Discord discordCredentialswebhookUrlusername
Slack slackCredentialswebhookUrlchannelName
Tumblr tumblrOAuthNone
DEV devtoCredentialsapiKeybaseUrl
Hashnode hashnodeCredentialstokenpublication
WordPress wordpressCredentialssiteUrlusernameappPassword
Ghost ghostCredentialsapiUrladminKey
Medium mediumCredentialstoken
Lemmy lemmyCredentialsinstanceusernamepasswordtotp
Nostr nostrCredentialsprivateKeyrelays
Listmonk listmonkCredentialsurlusernametoken
Farcaster farcasterCredentialsapiKeysignerUuid
Twitch twitchOAuthNone
Kick kickOAuthNone
Dribbble dribbbleOAuthNone
Custom webhook webhookCredentialsurlnamesecret

Connect with OAuth

Start a connection with POST /v1/connect/{platform} (or GET with the same fields as query parameters). The response has the authorization url to open and a state that identifies this connection. The link is valid for 30 minutes.

NameTypeDescription
redirectUrlurlWhere the person lands after approving. Postkea adds connected=PLATFORM and account=ACCOUNT_ID to it. Defaults to the dashboard's channels page.
profileIdstringPut the new account into this profile.
oauthAppIdstringUse one of your own registered OAuth apps instead of the shared one, so the consent screen shows your brand.
instancestringMastodon only: the server the account lives on, for example mastodon.social.
curl -X POST "https://postkea.com/api/v1/connect/instagram" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "redirectUrl": "https://yourapp.com/settings/social",
  "profileId": "prof_acme"
}'
Response
{
  "success": true,
  "data": {
    "url": "https://www.instagram.com/oauth/authorize?client_id=...&state=cs_9fKq2...",
    "state": "cs_9fKq2xV0m1"
  }
}

When the person approves, the account appears in GET /v1/accounts and an account.connected event is sent to your webhooks. If they decline or the network returns an error, they are sent to the dashboard with an error message.

Tokens are refreshed automatically. When a network revokes access (a changed password, removed permissions), the account status becomes reauth_required and you receive account.reauthorization_required. Start the same connection again to fix it; the existing account is updated, not duplicated.

Choosing pages and organizations

One login can unlock several accounts: Facebook Pages, Instagram business accounts, LinkedIn organizations, YouTube channels, Google Business locations or Pinterest accounts. When there is more than one, the person is sent to a selection page to pick which ones to connect, then on to your redirectUrl.

To build the selection step into your own product, read the pending accounts with the state you got when starting, and post the chosen platformUserId values. Both calls are public, so they work from your front end.

curl "https://postkea.com/api/v1/connect/selection/cs_9fKq2xV0m1" \
  -H "Authorization: Bearer $POSTKEA_API_KEY"
curl -X POST "https://postkea.com/api/v1/connect/selection/cs_9fKq2xV0m1" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "platformUserIds": [
    "17841400000000001",
    "17841400000000002"
  ]
}'

Connect with credentials

Bluesky (handle and app password), Telegram (bot token and channel), Discord and Slack (webhook URL), Mastodon (server and access token) and custom webhooks connect with POST /v1/connect/{platform}/credentials. Postkea checks the credentials with the network before saving the account.

curl -X POST "https://postkea.com/api/v1/connect/telegram/credentials" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "values": {
    "botToken": "123456:ABC-DEF...",
    "chatId": "@studiolumen"
  },
  "profileId": "prof_acme"
}'

Credentials are encrypted at rest and never returned by the API.

Listing and managing accounts

GET /v1/accounts lists every account. Filter with platform, profileId or status (active, reauth_required).

An account
{
  "id": "acc_li_3m9q",
  "platform": "linkedin",
  "platformUserId": "urn:li:organization:9071",
  "username": "studio-lumen",
  "displayName": "Studio Lumen",
  "avatarUrl": "https://media.licdn.com/...",
  "accountType": "organization",
  "profileId": "prof_acme",
  "status": "active",
  "statusReason": null,
  "followers": 2418,
  "schedule": null,
  "oauthAppId": null,
  "lastSyncedAt": "2026-10-20T08:00:00.000Z",
  "createdAt": "2026-09-02T14:11:09.000Z"
}
  • PATCH /v1/accounts/{id} renames an account or moves it to another profile with profileId (or null).
  • POST /v1/accounts/{id}/sync refreshes the follower count and profile details.
  • GET and PUT /v1/accounts/{id}/schedule read and set the queue time slots, see Scheduling and queue.
  • DELETE /v1/accounts/{id} disconnects the account, deletes its stored tokens and cancels its scheduled posts.

Platform helpers

Some networks need a lookup before you can post. Run it with GET /v1/accounts/{id}/helpers/{name}; extra query parameters are passed to the helper.

PlatformNameDescription
PinterestboardsBoards (and their ids) to use as boardId when pinning.
YouTubeplaylistsPlaylists of the channel, for playlistId.
TikTokcreatorInfoAllowed privacy levels, the maximum video length, and whether comments, duets and stitches are turned off for the creator.
curl "https://postkea.com/api/v1/accounts/acc_pin_2c7d/helpers/boards" \
  -H "Authorization: Bearer $POSTKEA_API_KEY"

Profiles

Profiles group accounts by client, brand or end user. They are how agencies keep clients apart and how SaaS products map accounts to their own users: set externalId to your own id.

curl -X POST "https://postkea.com/api/v1/profiles" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Acme Bakery",
  "externalId": "customer_4821",
  "color": "#E1306C"
}'

Pass profileId when connecting, posting, listing accounts or posts, reading usage, or creating webhooks that should only receive events about that profile. Deleting a profile keeps its accounts connected and moves them out of it.

A connect link is a hosted page you send to a client. They connect their own accounts into your workspace without creating a Postkea login, and the accounts land in the profile you chose. Connect links need the Creator plan or higher.

NameTypeDescription
profileIdstringProfile the connected accounts go into.
platformsstring[]Only offer these networks on the page.
titlestringHeading shown on the page.
messagestringA short note to your client.
redirectUrlurlWhere the client goes when they are done.
expiresInDaysintegerDays until the link stops working, up to 365.Default: 14
maxUsesintegerStop accepting connections after this many.
curl -X POST "https://postkea.com/api/v1/connect-links" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "profileId": "prof_acme",
  "platforms": [
    "instagram",
    "facebook",
    "tiktok"
  ],
  "title": "Connect your accounts to Studio Lumen",
  "expiresInDays": 7
}'

The response has the page url to share. List links with GET /v1/connect-links and revoke one with DELETE /v1/connect-links/{id}.

Your own OAuth apps

On Pro and Business you can register your own developer app for a network, so people see your app name and logo on the consent screen. Register it from a dashboard session with POST /v1/apps:

POST /v1/apps
{
  "platform": "linkedin",
  "name": "Acme Social",
  "clientId": "86abc...",
  "clientSecret": "WPL_AP1..."
}

Copy the redirectUri from the response into the app's settings on the network's developer portal, then pass oauthAppId when starting a connection. Accounts keep using the app they were connected with. Deleting an app moves its accounts back to the shared app, and they may need to reconnect.