Skip to Content

Publishing

One endpoint publishes to every network, with a result per platform.

POST /v1/posts publishes, schedules or saves a draft. One request can go to many accounts on different networks.

Publish now

curl -X POST https://api.postkey.dev/v1/posts \
  -H "x-access-key: $POSTKEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "We just shipped dark mode",
    "mediaItems": [
      { "type": "image", "url": "https://cdn.example.com/dark-mode.png", "altText": "The app in dark mode" }
    ],
    "platforms": [
      { "platform": "instagram", "accountId": "int_ig_123" },
      { "platform": "linkedin", "accountId": "int_li_456" },
      { "platform": "twitter", "accountId": "int_x_789" }
    ],
    "publishNow": true
  }'
Response
{
  "success": true,
  "postId": "post_8f21c",
  "status": "published",
  "platforms": [
    { "platform": "instagram", "accountId": "int_ig_123", "success": true, "platformPostUrl": "https://www.instagram.com/p/…" },
    { "platform": "linkedin", "accountId": "int_li_456", "success": true, "platformPostUrl": "https://www.linkedin.com/feed/update/…" },
    { "platform": "twitter", "accountId": "int_x_789", "success": true, "platformPostUrl": "https://x.com/acme/status/…" }
  ]
}

Request fields

FieldMeaning
contentThe text of the post.
mediaItemsOptional. A list of { type, url, altText?, thumbnail? }. type is image, video, gif or document. The url must be public, or come from Media upload.
platformsThe accounts to post to. Each item is { platform, accountId, content?, platformSpecificData? }.
publishNowtrue to publish right away.
scheduledFor + timezonePublish later. See Scheduling.
saveAsDrafttrue to save without publishing.

Pick one mode: publishNow, scheduledFor or saveAsDraft.

Different text per platform

Networks talk differently. Put content inside a platform item to override the top-level text for that platform only.

Request body
{
  "content": "Dark mode is here. 20 seconds to see it.",
  "mediaItems": [{ "type": "video", "url": "https://cdn.example.com/dark-mode.mp4" }],
  "platforms": [
    { "platform": "instagram", "accountId": "int_ig_123", "platformSpecificData": { "shareToFeed": true } },
    { "platform": "twitter", "accountId": "int_x_789", "content": "Dark mode is live. Settings > Appearance." }
  ],
  "publishNow": true
}

Platform options

platformSpecificData holds options only one network has. Some examples:

PlatformOptions
twitterthreadItems, replyToTweetId, replySettings, poll, communityId
instagramcontentType (story for a Story; videos post as Reels), shareToFeed, collaborators, coverUrl, locationId
facebookcontentType, link, videoThumbnailUrl
linkedinvisibility, mentions, documentTitle, articleUrl
tiktokprivacyLevel, disableComment, disableDuet, disableStitch, isAigc
youtubetitle, visibility, tags, playlistId, madeForKids, firstComment
pinterestboardId, title, link, altText
googlebusinesstopicType (update, offer, event), callToActionType, callToActionUrl, event and offer fields

The full list for every platform is in the API reference.

Partial success

Each platform publishes on its own. One failure never stops the others.

The post's overall status is:

StatusMeaning
publishedEvery platform worked.
partialSome worked, some failed. success is still true.
failedEvery platform failed. success is false.
publishingStill in progress, usually video. The final result comes by webhook.
scheduledWaiting for its time.
draftSaved, not published.

Each item in platforms has its own success, and either a platformPostUrl or a plain error:

Response · partial
{
  "success": true,
  "postId": "post_8f21c",
  "status": "partial",
  "platforms": [
    { "platform": "instagram", "accountId": "int_ig_123", "success": false, "error": "This is a personal account. Instagram only publishes to Business or Creator accounts." },
    { "platform": "linkedin", "accountId": "int_li_456", "success": true, "platformPostUrl": "https://www.linkedin.com/feed/update/…" },
    { "platform": "twitter", "accountId": "int_x_789", "success": true, "platformPostUrl": "https://x.com/acme/status/…" }
  ]
}

Refunds

Credits are charged per platform. A platform that fails gets its credits back automatically. In the example above, only LinkedIn and X are charged.

Retry the failed platforms

Fix the cause, then retry. Only the failed platforms are sent again. Platforms that already published are never posted twice.

curl -X POST https://api.postkey.dev/v1/posts/post_8f21c/retry \
  -H "x-access-key: $POSTKEY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

To retry later, send { "scheduledFor": "2026-12-01T18:00:00", "timezone": "America/New_York" }. A retry is charged again, and refunded again if it fails.

Drafts

Save a post without publishing. Drafts need no accounts and cost no credits.

Request body
{ "content": "Q1 launch post, waiting for sign-off", "platforms": [], "saveAsDraft": true }

Later, edit it with PUT /v1/posts/{postId} and publish or schedule it.

Other post calls

CallWhat it does
GET /v1/postsList posts. Filter by status, platform, profile and time.
GET /v1/posts/{postId}One post with its per-platform results.
PUT /v1/posts/{postId}Edit a draft or scheduled post.
DELETE /v1/posts/{postId}Delete a post.
POST /v1/posts/sync-externalImport recent posts made outside Postkey, for analytics.

Rate limits

Every network limits how much an account can post. Postkey queues posts to stay inside those limits, so you don't have to track them yourself.

On this page