Accounts and connecting
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.
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.
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"
}'const res = await fetch("https://postkea.com/api/v1/connect/instagram", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
redirectUrl: "https://yourapp.com/settings/social",
profileId: "prof_acme",
}),
});
const { data } = await res.json();
console.log(data);import os, requests
r = requests.post(
"https://postkea.com/api/v1/connect/instagram",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"redirectUrl": "https://yourapp.com/settings/social",
"profileId": "prof_acme",
},
)
data = r.json()["data"]
print(data){
"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.
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"const res = await fetch("https://postkea.com/api/v1/connect/selection/cs_9fKq2xV0m1", {
headers: { Authorization: `Bearer ${process.env.POSTKEA_API_KEY}` },
});
const { data: pending } = await res.json();
console.log(pending);import os, requests
r = requests.get(
"https://postkea.com/api/v1/connect/selection/cs_9fKq2xV0m1",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
)
pending = r.json()["data"]
print(pending)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"
]
}'const res = await fetch("https://postkea.com/api/v1/connect/selection/cs_9fKq2xV0m1", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
platformUserIds: ["17841400000000001", "17841400000000002"],
}),
});
const { data } = await res.json();
console.log(data);import os, requests
r = requests.post(
"https://postkea.com/api/v1/connect/selection/cs_9fKq2xV0m1",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"platformUserIds": ["17841400000000001", "17841400000000002"],
},
)
data = r.json()["data"]
print(data)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"
}'const res = await fetch("https://postkea.com/api/v1/connect/telegram/credentials", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
values: {
botToken: "123456:ABC-DEF...",
chatId: "@studiolumen",
},
profileId: "prof_acme",
}),
});
const { data } = await res.json();
console.log(data);import os, requests
r = requests.post(
"https://postkea.com/api/v1/connect/telegram/credentials",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"values": {
"botToken": "123456:ABC-DEF...",
"chatId": "@studiolumen",
},
"profileId": "prof_acme",
},
)
data = r.json()["data"]
print(data)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).
{
"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 withprofileId(ornull).POST /v1/accounts/{id}/syncrefreshes the follower count and profile details.GETandPUT /v1/accounts/{id}/scheduleread 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.
curl "https://postkea.com/api/v1/accounts/acc_pin_2c7d/helpers/boards" \
-H "Authorization: Bearer $POSTKEA_API_KEY"const res = await fetch("https://postkea.com/api/v1/accounts/acc_pin_2c7d/helpers/boards", {
headers: { Authorization: `Bearer ${process.env.POSTKEA_API_KEY}` },
});
const { data: boards } = await res.json();
console.log(boards);import os, requests
r = requests.get(
"https://postkea.com/api/v1/accounts/acc_pin_2c7d/helpers/boards",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
)
boards = r.json()["data"]
print(boards)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"
}'const res = await fetch("https://postkea.com/api/v1/profiles", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Acme Bakery",
externalId: "customer_4821",
color: "#E1306C",
}),
});
const { data: profile } = await res.json();
console.log(profile);import os, requests
r = requests.post(
"https://postkea.com/api/v1/profiles",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"name": "Acme Bakery",
"externalId": "customer_4821",
"color": "#E1306C",
},
)
profile = r.json()["data"]
print(profile)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.
Client connect links
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.
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
}'const res = await fetch("https://postkea.com/api/v1/connect-links", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.POSTKEA_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
profileId: "prof_acme",
platforms: ["instagram", "facebook", "tiktok"],
title: "Connect your accounts to Studio Lumen",
expiresInDays: 7,
}),
});
const { data: link } = await res.json();
console.log(link);import os, requests
r = requests.post(
"https://postkea.com/api/v1/connect-links",
headers={"Authorization": f"Bearer {os.environ['POSTKEA_API_KEY']}"},
json={
"profileId": "prof_acme",
"platforms": ["instagram", "facebook", "tiktok"],
"title": "Connect your accounts to Studio Lumen",
"expiresInDays": 7,
},
)
link = r.json()["data"]
print(link)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:
{
"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.