TikTok API

How to post on TikTok
via the API

Post and schedule on TikTok programmatically using the API. Create a key, connect TikTok, and upload the video.

the whole flow

Four steps, then it is scheduled

You call PostWing. PostWing publishes to TikTok at the time you set. The post also shows up on your calendar.

  1. 01Create an API key
  2. 02Connect TikTok
  3. 03Create the video
  4. 04Cross-post to more channels
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/v2.

02

Connect TikTok

Connect the TikTok account you want to post from. You only do this once.

The simple way is in the dashboard. Open Accounts, choose TikTok, and finish the TikTok login.

From the API, start that same login. Send platform tiktok. The response includes a url. Open it and approve TikTok.

Start connect

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

After you finish in the browser, sync. This imports the account into your workspace and returns the account id.

Sync

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

In the response, find the object where platform is tiktok or tiktok and copy id. That is the id you send when you create the post.

Sync response

{
  "data": [
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "platform": "tiktok",
      "handle": "brand",
      "display_name": "Brand",
      "status": "connected"
    }
  ]
}

Connected TikTok in the dashboard instead? List accounts and copy the same field:

List accounts

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

Create the video

TikTok needs a video or images. A caption by itself is not enough. Send the video, the caption, a future time, and the TikTok account id from sync. This call schedules the post. TikTok publishes it at scheduled_at. scheduled_at is UTC.

Create a video

curl -s -X POST "https://postwing.io/api/v2/posts" \
  -H "Authorization: Bearer pw_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "caption": "A 15-second look at the new menu.",
  "scheduled_at": "2026-10-12T15:00:00Z",
  "accounts": [
    { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012" }
  ],
  "media": [
    { "url": "https://cdn.example.com/menu.mp4", "type": "video" }
  ]
}'

You get back three things that matter:

  • id: the post id, for edits or cancelling later
  • status: scheduled until it publishes
  • accounts: each account, with url once it is live and error if it fails

Response

{
  "id": "7c1d2a8e-4b0f-4f8e-9a51-2f7f6b1c9d10",
  "status": "scheduled",
  "caption": "A 15-second look at the new menu.",
  "scheduled_at": "2026-10-12T15:00:00.000Z",
  "accounts": [
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "platform": "tiktok",
      "handle": "brand",
      "status": "scheduled",
      "url": null,
      "error": null
    }
  ],
  "dashboard_url": "https://postwing.io/dashboard/post/7c1d2a8e-4b0f-4f8e-9a51-2f7f6b1c9d10"
}

One video per post. The video URL has to be public HTTPS, and videos imported from a URL need to be 100MB or smaller. A caption is capped at about 2,200 characters. Leave the TikTok options off for a public post that allows comments, duets, and stitch.

04

Cross-post to all 8 platforms

The same video can go to Instagram and YouTube. Connect each channel, then copy its id from the sync response.

Connect Instagram

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

Connect YouTube

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

Open each url, finish the login, then sync once. Copy id where platform is instagram, and where platform is youtube.

Add those ids to accounts on the create call. YouTube still needs a title in its own options. One request. Every account publishes at the same scheduled_at. Leave caption off an account to use the shared caption. Set caption when that channel needs different text.

Create one video for three channels

curl -s -X POST "https://postwing.io/api/v2/posts" \
  -H "Authorization: Bearer pw_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "caption": "A 15-second look at the new menu.",
  "scheduled_at": "2026-10-12T15:00:00Z",
  "accounts": [
    { "id": "c3d4e5f6-a7b8-9012-cdef-123456789012" },
    { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901" },
    {
      "id": "a7b8c9d0-e1f2-3456-0123-567890123456",
      "options": {
        "title": "The new menu",
        "made_for_kids": false
      }
    }
  ],
  "media": [
    { "url": "https://cdn.example.com/menu.mp4", "type": "video" }
  ]
}'

Facebook, LinkedIn, X, and Threads can use this video too. Pinterest needs board_id in its own options. TikTok still needs the video or images.

images

Post images

An image post uses type image. title is for image posts only. A video does not use it.

Create an image post

curl -s -X POST "https://postwing.io/api/v2/posts" \
  -H "Authorization: Bearer pw_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "caption": "Three looks from the new drop.",
  "scheduled_at": "2026-10-12T18:00:00Z",
  "accounts": [
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "options": { "title": "New drop" }
    }
  ],
  "media": [
    { "url": "https://cdn.example.com/look-1.jpg", "type": "image" },
    { "url": "https://cdn.example.com/look-2.jpg", "type": "image" }
  ]
}'

Add more image objects in media, up to 30. A title is capped at 90 characters. Leave title off when you do not need one.

options

Privacy, drafts, and AI

These fields are optional. Leave them off for a public post. Set them on the TikTok account when you need control.

Save a private draft

curl -s -X POST "https://postwing.io/api/v2/posts" \
  -H "Authorization: Bearer pw_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "caption": "Holding this until we are ready.",
  "scheduled_at": "2026-10-12T18:00:00Z",
  "accounts": [
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
      "options": {
        "visibility": "private",
        "save_as_draft": true
      }
    }
  ],
  "media": [
    { "url": "https://cdn.example.com/menu.mp4", "type": "video" }
  ]
}'

visibility is public or private. The default is public. save_as_draft saves a draft in the TikTok app, and you finish it there.

allow_comments, allow_duets, and allow_stitches default to true. Set any of them to false to turn that off. ai_generated defaults to false. Set it to true to mark the post as AI-generated.

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.
  • POST /posts schedules the post right away. You can still edit or cancel it until it publishes.
  • TikTok needs a video or images. A caption by itself is not enough.
  • title is for image posts only. A video does not use it.
  • visibility defaults to public. Comments, duets, and stitch default to allowed.
  • save_as_draft saves a draft in the TikTok app. ai_generated marks the post as AI-generated.
  • The response includes the post id. Use it to edit with PATCH /posts/{id} or cancel with DELETE /posts/{id}.
  • API access is included on every plan, from $9.99/mo. Posts count as normal posts on your account.

questions

TikTok API FAQ

No. TikTok needs a video or images in media, plus the TikTok account id.

ready when you are

Schedule your next TikTok post from the API

Create a key, connect TikTok, and upload the video.