TikTok

How to Post to TikTok via API

The request flow for publishing video to TikTok programmatically, from connection to delivery confirmation.

Quick answer

To post to TikTok via API: the creator connects their account through TikTok OAuth, you upload media through PostGate’s media endpoint (one MP4 video up to 4 GB, or 1–35 JPEG/WEBP photos), then create the post with mode "inbox" or "direct" — direct posting also requires a creator-approved privacy level and a music-usage confirmation — and confirm delivery from target-level status.

Posting to TikTok programmatically means four things happening in sequence: the creator connects their account, you upload media, you submit the post, and you confirm delivery from target-level status rather than a single success flag. Here is that flow through PostGate's API, using PostGate's already-audited TikTok app so nothing here waits on your own developer app review.

01

1. Connect the creator’s TikTok account

Start a hosted connection and send the customer to the returned URL. TikTok uses OAuth, so PostGate collects consent directly on TikTok's own domain — your product never touches the access token.

Start a TikTok connectionPostGate API
curl -X POST https://postgate.studio/api/profiles/connect \
  -H "Authorization: Bearer pg_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "tiktok",
    "profile_group_id": "grp_acme123",
    "return_url": "https://app.example.com/settings/social"
  }'
02

2. Upload the video or photos

Upload media through PostGate's media endpoint first and reference the resulting media IDs on the post. TikTok accepts exactly one MP4 video (up to 4 GB, 3 seconds–10 minutes) or 1–35 JPEG/WEBP photos — not a mix of the two, and not PNG.

03

3. Create the post

Choose mode: "inbox" for a draft the creator reviews and posts manually inside TikTok, or mode: "direct" to publish immediately — direct posting additionally requires a creator-approved privacy level and a music-usage confirmation. See direct post vs. inbox mode before choosing.

Publish (direct mode)PostGate API
curl -X POST https://postgate.studio/api/posts \
  -H "Authorization: Bearer pg_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: launch-video-482" \
  -d '{
    "post": {
      "body": "New drop, out now.",
      "options": {
        "tiktok": {
          "mode": "direct",
          "title": "New drop, out now.",
          "privacy": "SELF_ONLY",
          "music_usage_confirmed": true
        }
      }
    },
    "profiles": ["pro_tiktok123"],
    "media": ["med_01JXYZ"]
  }'
04

4. Confirm delivery from target status

Poll the post or consume PostGate's webhooks and read the TikTok target's status specifically — published with a platform_post_id and permalink means it landed. Because TikTok processes video asynchronously, expect a target to sit at publishing briefly before it resolves.

05

5. Handle the TikTok-specific edge cases

Two rejections are TikTok platform behavior, not integration bugs: a direct post forced private because your client hasn't passed TikTok's own audit, and a new connection rejected because your app hit its active-user cap. Both are covered in detail in PostGate's TikTok posts: unaudited_client_can_only_post_to_private_accounts and reached_active_user_cap.

Frequently asked questions

What media formats does the TikTok API accept?

Exactly one MP4 video (up to 4 GB, 3 seconds–10 minutes) or 1–35 JPEG/WEBP photos — not a mix of the two, and not PNG. Upload media through PostGate’s media endpoint first and reference the resulting media IDs on the post.

What is the difference between TikTok’s inbox and direct posting modes?

mode: "inbox" creates a draft the creator reviews and posts manually inside TikTok. mode: "direct" publishes immediately, but additionally requires a creator-approved privacy level and a music-usage confirmation.

Do I need my own TikTok developer app audit to post via API?

Not with PostGate — the flow uses PostGate’s already-audited TikTok app, so nothing waits on your own developer app review. With an unaudited client of your own, TikTok forces direct posts private (unaudited_client_can_only_post_to_private_accounts), and a new connection can also be rejected if your app hits its active-user cap.

Why is my TikTok post stuck at publishing?

TikTok processes video asynchronously, so expect a target to sit at publishing briefly before it resolves. Poll the post or consume PostGate’s webhooks and read the TikTok target’s status specifically — published with a platform_post_id and permalink means it landed.

Build it with PostGate

One API for every social platform your customers care about — sandboxed, documented, and ready today.

Start building Read the docs