Sign in

Accounts

List the accounts you connected, with their health and the formats each one can publish. Get the link that connects or reconnects an account, save the keys of your own X app, disconnect an account, and read a TikTok account's creator info before every TikTok post.

Every post goes to one connected account, chosen by its id. Connecting an account needs the network's own sign-in screen, which only a person can accept in a browser: the API gives you the link to open, see Connect or reconnect an account. The API lists your accounts so your code can find the right id, check that the account can publish, and learn which formats and limits apply.

List your accounts

GET /api/v1/accounts returns every account connected to your user, oldest first. There is no pagination.

cURL
curl https://linkpost.app/api/v1/accounts \
  -H "Authorization: Bearer $LINKPOST_KEY"
JavaScript
const response = await fetch("https://linkpost.app/api/v1/accounts", {
  headers: { Authorization: `Bearer ${process.env.LINKPOST_KEY}` },
});
const { data: accounts } = await response.json();

for (const account of accounts) {
  const formats = account.formats.map((f) => f.format).join(", ");
  console.log(`${account.id} ${account.platform} ${account.name} (${account.health}): ${formats}`);
}
Python
import os

import requests

response = requests.get(
    "https://linkpost.app/api/v1/accounts",
    headers={"Authorization": f"Bearer {os.environ['LINKPOST_KEY']}"},
    timeout=30,
)

for account in response.json()["data"]:
    formats = ", ".join(f["format"] for f in account["formats"])
    print(f"{account['id']} {account['platform']} {account['name']} ({account['health']}): {formats}")
PHP
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client([
    'base_uri' => 'https://linkpost.app/api/v1/',
    'headers' => ['Authorization' => 'Bearer '.getenv('LINKPOST_KEY')],
    'http_errors' => false,
]);

$accounts = json_decode((string) $client->get('accounts')->getBody(), true)['data'];

foreach ($accounts as $account) {
    $formats = implode(', ', array_column($account['formats'], 'format'));
    echo "{$account['id']} {$account['platform']} {$account['name']} ({$account['health']}): {$formats}", PHP_EOL;
}

The response, for a user with a TikTok account, a LinkedIn profile and an X profile:

JSON
{
  "data": [
    {
      "id": 7,
      "platform": "tiktok",
      "name": "Mara Costa",
      "avatar_url": "https://p16-sign.tiktokcdn.com/tos-maliva-avt/maracosta.jpeg",
      "health": "ok",
      "health_label": "Connected",
      "post_options": { "mode": ["direct", "inbox"] },
      "formats": [
        { "format": "video", "label": "Video", "takes": ["video"], "min_files": 1, "max_files": 1, "max_text": 2200, "video_limits": { "min_side": 360, "max_side": 4096, "min_fps": 23, "max_fps": 60, "codecs": ["h264", "hevc", "vp8", "vp9"] }, "hint": "One video." }
      ],
      "connected_at": "2026-09-14T08:02:51Z"
    },
    {
      "id": 21,
      "platform": "linkedin",
      "name": "Mara Costa",
      "avatar_url": "https://media.licdn.com/dms/image/maracosta.jpg",
      "health": "expiring",
      "health_label": "Access expires 6 days from now",
      "post_options": { "privacy_level": ["PUBLIC", "CONNECTIONS"] },
      "formats": [
        { "format": "text", "label": "Text", "takes": [], "min_files": 0, "max_files": 0, "max_text": 3000, "hint": "A post with text only. A link shows its preview." },
        { "format": "image", "label": "Photos", "takes": ["image"], "min_files": 1, "max_files": 20, "max_text": 3000, "hint": "Up to 20 photos." },
        { "format": "video", "label": "Video", "takes": ["video"], "min_files": 1, "max_files": 1, "max_text": 3000, "video_limits": { "min_bytes": 76800 }, "hint": "One video." },
        { "format": "document", "label": "Document", "takes": ["document"], "min_files": 1, "max_files": 1, "max_text": 3000, "hint": "One PDF, PowerPoint or Word file, shown as a swipeable carousel." },
        { "format": "poll", "label": "Poll", "takes": [], "min_files": 0, "max_files": 0, "max_text": 140, "poll_answers": 4, "poll_answer_chars": 30, "hint": "The text is the question. 2 to 4 answers of up to 30 characters." }
      ],
      "connected_at": "2026-09-20T16:40:03Z"
    },
    {
      "id": 24,
      "platform": "x",
      "name": "@maracosta",
      "avatar_url": "https://pbs.twimg.com/profile_images/maracosta_400x400.jpg",
      "health": "ok",
      "health_label": "Connected",
      "post_options": { "format": ["video"] },
      "formats": [
        { "format": "text", "label": "Text", "takes": [], "min_files": 0, "max_files": 0, "max_text": 280, "threads": true, "hint": "A post with text only. A link shows its preview." },
        { "format": "image", "label": "Photos", "takes": ["image"], "min_files": 1, "max_files": 4, "max_text": 280, "threads": true, "hint": "Up to 4 photos." },
        { "format": "video", "label": "Video", "takes": ["video"], "min_files": 1, "max_files": 1, "max_text": 280, "threads": true, "video_limits": { "min_side": 32, "ratio": ["1:3", "3:1"], "max_fps": 60 }, "hint": "One video, up to 140 seconds." },
        { "format": "poll", "label": "Poll", "takes": [], "min_files": 0, "max_files": 0, "max_text": 280, "poll_answers": 4, "poll_answer_chars": 25, "threads": true, "hint": "The text is the question. 2 to 4 answers of up to 25 characters." }
      ],
      "connected_at": "2026-10-01T11:22:09Z"
    }
  ]
}

In this example the LinkedIn and X accounts show text, photo, document and poll formats. Those are pending Meta and TikTok certification. On an account where they are not available yet, formats lists only the video formats.

Account fields

Field Type What it is
id number The account id. Send it as account_id when you create a post.
platform string tiktok, instagram, facebook, youtube, linkedin, x, bluesky or telegram.
name string The name Linkpost shows for the account: a username, a Page or channel name, or an @handle.
avatar_url string or null The account picture, from the network.
health string ok, expiring or reconnect. See below.
health_label string health in words, as the app shows it.
post_options object The choices for a video post on this account. See below.
formats list Every format you can publish on this account, with its limits. See below.
connected_at string When the account was connected, in UTC.
stats object or null The latest follower reading, with the time it was read. null until the first one, or on networks that do not give it. See Numbers and links.

Linkpost never returns the network's access tokens.

health

health health_label What it means What to do
ok Connected The account can publish. Nothing.
expiring Access expires 6 days from now The account still publishes, but the network's access ends soon. This happens on TikTok and LinkedIn, 14 days before the end. Connect the account again in the app before the date.
reconnect Reconnect needed The network refused Linkpost's access, or the access ended. Connect the account again, in the app or with the link from Connect or reconnect an account. Posts to it fail until then.

Check health before you publish. A post to an account that needs reconnecting is refused with 422 on TikTok. On the other networks it is accepted and then fails when Linkpost sends it, with a fail_reason such as LinkedIn refused Linkpost's access. Connect the account again.

post_options

post_options lists the values a video post can take on this account.

platform post_options What it tells you
tiktok { "mode": ["direct", "inbox"] } The modes this account allows. direct publishes to the profile. inbox sends a draft to the TikTok app. A mode missing from the list was not granted when the account was connected.
instagram { "format": ["reel", "story"] } The video formats.
facebook { "format": ["video", "story"] } The video formats.
youtube { "format": ["video", "short"], "privacy_level": ["public", "unlisted", "private"] } The values for format and for privacy_level, which YouTube requires.
linkedin { "privacy_level": ["PUBLIC", "CONNECTIONS"] } The values for privacy_level, which LinkedIn videos require. Every other LinkedIn post takes it too, and is PUBLIC without it.
x, bluesky, telegram { "format": ["video"] } The video format.

formats

formats lists every format your user can publish on the account right now. Send the format value when you create the post. Read this list instead of hard-coding formats: formats still pending Meta and TikTok certification only appear here once they are available to you.

Field What it is
format The value to send as format: video, reel, story, text, image, carousel, document or poll.
label The name the app shows for the format.
takes The kinds of file the format takes: video, image or document. Empty for text posts and polls. A story takes a video or an image, and an Instagram carousel takes both.
min_files, max_files How many files the post needs. 0 for text posts and polls.
max_text The longest title allowed, in characters. 0 means the format has no text, like a story.
poll_answers Polls only. The most answers a poll can have. Every poll needs at least 2.
poll_answer_chars Polls only. The longest answer, in characters.
threads Present and true on X and Bluesky, where thread[] adds replies to the post.
video_limits Formats that take a video, when the network sets limits for it. What Linkpost checks in the video before uploading it. See below.
hint A short description of the format.

Fields that do not apply to a format are left out. Posts has the full table of formats and limits for every network.

video_limits

video_limits is what the network's API takes in a video of this format. Linkpost checks every video against it before uploading anything, and answers 422 on media for a video outside it (on files in a carousel), with a message that says what to export instead. See Errors. Only the keys that apply appear. The field is left out when the network sets no such limits, as on YouTube, Bluesky, Telegram and Facebook Page videos.

Key What it is
min_side, max_side The fewest and the most pixels on each side.
min_short_side The fewest pixels on the shorter side.
max_width The most pixels across.
ratio The narrowest and the widest shape, as width:height. ["9:16", "16:9"] takes anything from a vertical 9:16 video to a landscape 16:9 one.
min_fps, max_fps The fewest and the most frames per second.
codecs The video codecs the network takes: h264, hevc, vp8, vp9 or av1. Checked only when the file says which one it uses.
min_bytes The smallest file, in bytes.
max_mb The largest file, in MB, where the format takes less than the network's usual limit.

An Instagram reel:

JSON
{ "format": "reel", "label": "Reel", "takes": ["video"], "min_files": 1, "max_files": 1, "max_text": 2200, "video_limits": { "max_width": 1920, "ratio": ["1:100", "10:1"], "min_fps": 23, "max_fps": 60, "codecs": ["h264", "hevc"] }, "hint": "One video." }

Get TikTok creator info

GET /api/v1/accounts/{id}/creator-info reads a TikTok account's current settings, live from TikTok. Call it right before every TikTok post, and build the post from what it returns.

cURL
curl https://linkpost.app/api/v1/accounts/7/creator-info \
  -H "Authorization: Bearer $LINKPOST_KEY"
JavaScript
const response = await fetch("https://linkpost.app/api/v1/accounts/7/creator-info", {
  headers: { Authorization: `Bearer ${process.env.LINKPOST_KEY}` },
});
const body = await response.json();

if (!response.ok) {
  throw new Error(`${response.status}: ${body.message}`);
}

console.log(`Posting as ${body.data.nickname}. Visibility options: ${body.data.privacy_level_options.join(", ")}`);
Python
import os

import requests

response = requests.get(
    "https://linkpost.app/api/v1/accounts/7/creator-info",
    headers={"Authorization": f"Bearer {os.environ['LINKPOST_KEY']}"},
    timeout=30,
)
body = response.json()

if not response.ok:
    raise SystemExit(f"{response.status_code}: {body['message']}")

creator = body["data"]
print(f"Posting as {creator['nickname']}. Visibility options: {', '.join(creator['privacy_level_options'])}")
PHP
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client([
    'base_uri' => 'https://linkpost.app/api/v1/',
    'headers' => ['Authorization' => 'Bearer '.getenv('LINKPOST_KEY')],
    'http_errors' => false,
]);

$response = $client->get('accounts/7/creator-info');
$body = json_decode((string) $response->getBody(), true);

if ($response->getStatusCode() !== 200) {
    exit($response->getStatusCode().': '.$body['message'].PHP_EOL);
}

echo 'Posting as ', $body['data']['nickname'], '. Visibility options: ', implode(', ', $body['data']['privacy_level_options']), PHP_EOL;
JSON
{
  "data": {
    "nickname": "Mara Costa",
    "username": "maracosta",
    "avatar_url": "https://p16-sign.tiktokcdn.com/tos-maliva-avt/maracosta.jpeg",
    "privacy_level_options": ["PUBLIC_TO_EVERYONE", "MUTUAL_FOLLOW_FRIENDS", "SELF_ONLY"],
    "comment_disabled": false,
    "duet_disabled": true,
    "stitch_disabled": false,
    "max_video_duration_seconds": 600,
    "is_private": false,
    "direct_post_available": true,
    "direct_post_problem": null
  }
}
Field What it is
nickname The creator's display name. Show it to the person who posts, so they know which account the post goes to.
username The creator's TikTok username.
avatar_url The creator's picture.
privacy_level_options The values privacy_level can take for this creator right now.
comment_disabled true when the creator turned comments off. You cannot send allow_comment=1.
duet_disabled true when the creator turned duets off. You cannot send allow_duet=1.
stitch_disabled true when the creator turned stitches off. You cannot send allow_stitch=1.
max_video_duration_seconds The longest video this creator can post, in seconds.
is_private true when the TikTok account is private.
direct_post_available true when the account can take a post with mode=direct now. It is false while TikTok has not approved Linkpost and the account is public: send the post with mode=inbox then.
direct_post_problem Why direct_post_available is false, in words to show the person who posts. null when it is true.

The visibility values and what TikTok calls them:

privacy_level Shown in TikTok as
PUBLIC_TO_EVERYONE Everyone
MUTUAL_FOLLOW_FRIENDS Friends
FOLLOWER_OF_CREATOR Followers
SELF_ONLY Only me

Why you read it before every TikTok post

  • Visibility has no default. TikTok requires the person posting to choose who can see each post, and the choices depend on the creator. A private account, for example, does not offer PUBLIC_TO_EVERYONE. Show privacy_level_options to the person and send the one they pick. Never pick one for them.
  • The creator decides about interactions. If the creator turned off comments, duets or stitches in TikTok, you cannot turn them on for a post. Offer only the ones that are allowed, and leave them off unless the person asks for them.
  • The longest video depends on the creator. A video longer than max_video_duration_seconds is refused.
  • A public account cannot take direct posts yet. Until TikTok approves Linkpost, it only takes direct posts from private accounts. When direct_post_available is false, show direct_post_problem to the person and send the post with mode=inbox: one with mode=direct is refused.
  • The settings change. A creator can change them in TikTok at any time, so a value you read yesterday may be wrong today.
  • TikTok's rules ask for it. TikTok's Content Sharing Guidelines ask apps to show the creator's nickname and let the person choose the visibility and interactions before each post.

Linkpost reads the creator info again when you create the post and refuses anything that does not fit, so reading it first lets you send a request that works. For a scheduled post, Linkpost reads it once more when the post goes out. If the creator changed something that the post relied on, the post fails with a fail_reason that ends in Nothing was sent.

TikTok allows only a few creator info queries a minute per account. Call it once before each post, not in a loop.

If creator info fails

Status Body What to do
404 { "message": "Not found." } The id is not one of your accounts. List your accounts to find it.
409 { "message": "TikTok access expired or was revoked. Connect the account again." } Connect the TikTok account again in the app.
422 { "message": "Only TikTok accounts have creator info." } The account is not a TikTok account. Other networks do not need this call.
503 { "message": "TikTok limits how often this account can be queried. Wait a minute and try again." } TikTok did not answer or asked to slow down. Try again in a minute.

Other 503 messages are This TikTok account cannot post right now. Please try again later. and TikTok is temporarily unavailable. Try again in a minute. In both cases, wait and call again. Linkpost does not retry this call for you.

Connect or reconnect an account

GET /api/v1/connect-links gives the link that connects an account. A network only lets a person accept its sign-in screen, in a browser, so no program can connect an account on its own. Send the link to the person who owns the account. They open it in a browser where they are signed in to Linkpost, or sign in first, and accept the network's screen. Then the account appears in List your accounts.

The same link reconnects an account whose health is reconnect or expiring.

Query What it is
network Optional. tiktok, instagram, facebook, youtube, linkedin, linkedin_pages (LinkedIn Company Pages), x, bluesky or telegram. Without it, you get a link for every network your account can connect.
cURL
curl "https://linkpost.app/api/v1/connect-links?network=tiktok"   -H "Authorization: Bearer $LINKPOST_KEY"
JSON
{
  "data": [
    {
      "network": "tiktok",
      "name": "TikTok",
      "publishes": "Videos on your profile, or drafts in your TikTok inbox.",
      "url": "https://linkpost.app/connect/tiktok",
      "how_to": "Open the link in a browser signed in to Linkpost (it asks to sign in first otherwise) and accept TikTok's screen. Then list the accounts: the new one appears there. The same link reconnects an account that needs it."
    }
  ]
}
Field What it is
network The network, as you send it in network.
name The network's name.
publishes What Linkpost publishes on that network for your account.
url The link to open in a browser.
how_to What the person does with the link, in words you can pass on.
limit Only when a new account would be refused: the reason, from your plan or your billing, such as The first 2 connections are free. To connect more, add your billing details and a card in Settings > Billing: …. Reconnecting an account you already have always works. See Pricing and billing.

For X, the link works once the keys of your own X app are saved. Until then, its how_to says to save them first, with Save your X app keys or on the page the link opens.

A network your account cannot connect answers 422, for example x cannot be connected on this account right now. Ask without a network to see the ones that can. An unknown network answers 422 with the list of the valid ones.

Your X app

X needs your own X app. Since February 2026, X charges for every post made through its API, so each user creates an app in the X Developer Console, buys credits there and gives Linkpost its OAuth 2.0 Client ID and Client Secret. X bills you directly, at its own price, and Linkpost charges nothing for X. The steps in X's console are in Create your X app.

These endpoints read, save and remove the keys, as the Connect X with your own app page does in the app. Without keys you cannot connect X, and your X accounts cannot post.

Method Path What it does
GET /api/v1/x-app Reads whether your keys are saved, and the addresses your app must list.
PUT /api/v1/x-app Saves the Client ID and Client Secret of your X app.
DELETE /api/v1/x-app Removes the keys.

Read your X app

GET /api/v1/x-app says whether your keys are saved. The Client Secret is never returned.

cURL
curl https://linkpost.app/api/v1/x-app \
  -H "Authorization: Bearer $LINKPOST_KEY"
JSON
{
  "data": {
    "configured": true,
    "client_id": "M1M5R3BMVy13QmpScXkzTUt5OE46MTpjaQ",
    "updated_at": "2026-11-28T12:00:00Z",
    "callback_url": "https://linkpost.app/connect/x/callback",
    "website_url": "https://linkpost.app",
    "console_url": "https://console.x.com",
    "x_accounts": 1
  }
}
Field What it is
configured true when your keys are saved.
client_id The OAuth 2.0 Client ID you saved, or null.
updated_at When the keys were last saved, in UTC, or null.
callback_url The Callback URI your X app must list, exactly.
website_url The Website URL of your X app.
console_url The X Developer Console, where you create the app, buy credits and find its keys under Keys and tokens.
x_accounts How many X accounts you have connected. They all use these keys.

Save your X app keys

PUT /api/v1/x-app saves the keys of your X app, from Keys and tokens in the X Developer Console. Linkpost stores the secret encrypted. The answer has the same fields as Read your X app.

Field What it is
client_id Required. The OAuth 2.0 Client ID of your X app.
client_secret The OAuth 2.0 Client Secret. Required the first time and when client_id changes. With the same client_id, leave it out to keep the saved one.
cURL
curl -X PUT https://linkpost.app/api/v1/x-app \
  -H "Authorization: Bearer $LINKPOST_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "client_id": "M1M5R3BMVy13QmpScXkzTUt5OE46MTpjaQ", "client_secret": "your-client-secret" }'
  • A new secret for the same app. Send the same client_id with the new client_secret. Your X accounts keep working.
  • Another app. A different client_id changes to another app. Every X account you have changes to "health": "reconnect", because its access belongs to the old app, and its scheduled posts fail until it is reconnected.

Then connect or reconnect X with Connect or reconnect an account: a person opens the link and accepts X's screen.

Linkpost checks only that the keys look right. X checks them when a person connects an account, and refuses keys that are wrong.

Message What it means
Paste the OAuth 2.0 Client ID of your X app. The request had no client_id.
That does not look like an OAuth 2.0 Client ID. Copy it from Keys and tokens in the X Developer Console. client_id is not a Client ID. Often it is the API Key or the Bearer Token.
Paste the OAuth 2.0 Client Secret of your X app. The request had no client_secret, the first time or with another client_id.
That does not look like an OAuth 2.0 Client Secret. Copy it from Keys and tokens in the X Developer Console. client_secret is not a Client Secret. Often it is the API Secret.

They come with 422, under client_id or client_secret.

Remove your X app keys

DELETE /api/v1/x-app forgets the keys of your X app.

cURL
curl -X DELETE https://linkpost.app/api/v1/x-app \
  -H "Authorization: Bearer $LINKPOST_KEY"
JSON
{ "data": { "removed": true, "configured": false, "client_id": null, "updated_at": null, "callback_url": "https://linkpost.app/connect/x/callback", "website_url": "https://linkpost.app", "console_url": "https://console.x.com", "x_accounts": 1 } }

removed is false when there were no keys to remove. Your X accounts stay listed with "health": "reconnect", and their scheduled posts fail until you save keys again and reconnect them. The app itself stays in X's console.

You can save or remove the keys up to 10 times a minute.

Disconnect an account

DELETE /api/v1/accounts/{id} disconnects an account, as Disconnect does in the app. Linkpost deletes its access tokens and revokes its access where the network allows it. Posts still waiting to go out to it fail. Published posts stay in your list of posts.

cURL
curl -X DELETE https://linkpost.app/api/v1/accounts/12   -H "Authorization: Bearer $LINKPOST_KEY"
JSON
{ "data": { "id": 12, "platform": "instagram", "disconnected": true, "posts_failed": 1 } }

posts_failed counts the posts that were waiting for the account and failed because of it. To connect the account again, use Connect or reconnect an account. On the new pricing, an account stops counting for your invoice from the next day. See Connect and disconnect accounts.

Disconnecting cannot be undone, and another user's account answers 404. You can disconnect up to 10 accounts a minute.