one API

How to post on social media
via one API

Post and schedule to 8 social platforms programmatically using one API. Create a key, connect your accounts, and create the post.

the whole flow

Four steps, then it is scheduled

You call PostWing once. PostWing publishes to every account in targets at the time you set. The post also shows up on your calendar.

  1. 01Create an API key
  2. 02Connect each channel
  3. 03Create one post
  4. 04Confirm once
01

Create an API key

Open Dashboard → AI & API and create a key. Copy it once. It starts with pw_live_. Send it on every request:

Header

Authorization: Bearer pw_live_…

Every URL below starts at https://postwing.io/api/v1. The same key works for all 8 platforms.

02

Connect each channel

Connect each account once. The simple way is in the dashboard. Open Accounts and finish the login for each channel.

From the API, start one login at a time. The response includes a url. Open it and approve that platform.

Start connect

curl -s -X POST "https://postwing.io/api/v1/accounts" \
  -H "Authorization: Bearer pw_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "platform": "linkedin" }'

platform is one of facebook, instagram, linkedin, pinterest, threads, tiktok, x, or youtube. After the logins, sync once. Copy account_id from each object. TikTok can come back as tiktok or tiktok_business.

Sync

curl -s -X POST "https://postwing.io/api/v1/accounts/sync" \
  -H "Authorization: Bearer pw_live_…"

Already connected in the dashboard? List accounts and copy the same ids:

List accounts

curl -s -X GET "https://postwing.io/api/v1/accounts" \
  -H "Authorization: Bearer pw_live_…"
03

Create one post

One request holds every channel. Send the shared caption, a future time, and each account_id in targets. This call creates the post. Nothing publishes until you confirm. scheduled_at is UTC, and every account uses that same time.

Create one text post for four channels

curl -s -X POST "https://postwing.io/api/v1/posts/preview" \
  -H "Authorization: Bearer pw_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "caption": "We just shipped a faster way to publish updates.",
  "scheduled_at": "2026-10-12T15:00:00Z",
  "targets": [
    { "account_id": "d4e5f6a7-b8c9-0123-def0-234567890123" },
    {
      "account_id": "e5f6a7b8-c9d0-1234-ef01-345678901234",
      "caption": "Faster publishing, now live."
    },
    { "account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" },
    {
      "account_id": "b8c9d0e1-f2a3-4567-8901-678901234567",
      "caption": "Faster publishing, now live."
    }
  ]
}'

Those four ids are LinkedIn, X, Facebook, and Threads. Leave caption off a target to use the shared caption. Set caption when that channel needs shorter text. X is about 280 characters. Threads is about 500.

You get back three things that matter:

  • preview: the caption, time, and every account. Check this before you confirm.
  • confirmation_token: you send this in the next step
  • expires_in_seconds: 300, so the token lasts 5 minutes
04

Confirm once

When the preview lists the right accounts, confirm with the token from that response. Use the token as-is. Do not invent one. One confirm schedules every target.

Confirm

curl -s -X POST "https://postwing.io/api/v1/posts/confirm" \
  -H "Authorization: Bearer pw_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "confirmation_token": "eyJ…signature" }'

The response includes view_url. Open it to see the post on your calendar. Every account publishes at the time you set. You can edit or cancel later from the dashboard or with the same API.

If confirm says the token expired, create the post again and confirm the new token within 5 minutes.

media

Add an image or a video

Put media_items on the same request when a channel needs a file. The image or video is shared. Platform rules stay on each target.

Create one image post for three channels

curl -s -X POST "https://postwing.io/api/v1/posts/preview" \
  -H "Authorization: Bearer pw_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "caption": "New lookbook, now live.",
  "scheduled_at": "2026-10-12T18:00:00Z",
  "targets": [
    { "account_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" },
    { "account_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" },
    {
      "account_id": "f6a7b8c9-d0e1-2345-f012-456789012345",
      "platform_options": {
        "board_ids": ["1234567890"]
      }
    }
  ],
  "media_items": [
    { "url": "https://cdn.example.com/lookbook.jpg", "type": "image" }
  ]
}'

Those ids are Instagram, Facebook, and Pinterest. Pinterest keeps board_ids on its own target. TikTok can use this image too. For a video, send one item with type video. YouTube needs that video plus a title on its target.

The file URL has to be public HTTPS. Videos imported from a URL need to be 100MB or smaller. A file on your computer uses the direct upload URL, covered in the API docs.

Details worth knowing

  • scheduled_at has to be a future time in ISO 8601, usually UTC. Every target uses that time.
  • Creating the post does not publish it. One confirm schedules every account in targets.
  • The same API key posts to Instagram, TikTok, YouTube, LinkedIn, X, Facebook, Pinterest, and Threads.
  • Leave caption off a target to use the shared caption. Set it when that channel needs different text.
  • Instagram and TikTok need media. YouTube needs a video and a title. Pinterest needs media and board_ids.
  • The confirmation token expires in 5 minutes and only works for the user who created the post.
  • API access is included on every plan, from $9.99/mo. Posts count as normal posts on your account.

questions

Social media API FAQ

Yes. Put each account_id in targets and confirm once. They publish together at scheduled_at. A channel is skipped only when its own rules are missing, such as media, a YouTube title, or Pinterest board_ids.

ready when you are

Schedule every channel from one API

Create a key, connect your accounts, and create the post.