PostZen

TikTok

Connect TikTok to PostZen, publish or schedule video and photo posts, manage comments, and read video and audience insights.

PostZen publishes and schedules TikTok video and photo posts through the same /v1/posts endpoint used for other platforms. Each TikTok post needs media, and a single post cannot mix images and video. A connected account also brings its comments into the PostZen inbox and its video and audience insights into analytics.

Quick reference

RequirementTikTok limit
Video post mediaExactly 1 video
Photo post mediaTikTok allows up to 35 images; a PostZen request accepts up to 10 mediaItems
CaptionUp to 2,200 characters for video posts
Photo post titleUp to 90 characters
Video file sizeUp to 4 GB
PostZen presigned image upload typesjpeg, jpg, png, webp, gif; TikTok rejects GIF photo posts
PostZen presigned video upload typesmp4, mpeg, quicktime, avi, webm, m4v
GIF photo postsNot supported
Mixed image and video postsNot supported
Recommended layout9:16 vertical at 1080×1920
Immediate publishingSupported with publishNow
SchedulingSupported with scheduledFor
Draft uploadSupported with settings.uploadAsDraft
Video privacyPublic or draft on a TikTok for Business connection; every level the creator allows on an earlier connection. See Connection lanes
Photo post privacyEvery level the creator allows
Posting limit15 videos and 15 photo posts a day per account, and 6 a minute, on a TikTok for Business connection
AI-generated labelSupported with settings.isAigc on direct posts

Before you start

You need a PostZen profile and a connected TikTok account. TikTok uses OAuth 2.0, and PostZen asks for the posting, comment, and insight permissions in one login.

  • Set POSTZEN_API_KEY in your environment before using the examples below.
  • Keep the profile ID for the workspace that will own the connection and the account ID returned for the connected TikTok account.
  • Include media with each TikTok post. Text-only posts fail validation.
  • Use either one video or images. TikTok posts cannot combine the two media types.
  • Set privacyLevel unless you set uploadAsDraft: true. The available privacy levels depend on the creator's TikTok account settings, and a video on a TikTok for Business connection can only be publicToEveryone.
  • The Free plan includes 2 connected accounts and does not allow extras. Connecting a third account returns a 402.

Cloud-storage share links from Google Drive, Dropbox, OneDrive, and iCloud return HTML pages instead of media files. Use a publicly accessible direct media URL, or upload the file through /v1/media/presign. External URLs can be up to 100 MB; presigned uploads can be up to 5 GB, while TikTok videos remain limited to 4 GB.

Connect your account

Request a TikTok connect URL for your PostZen profile, then send the user to the returned authUrl. The returned OAuth state expires after 10 minutes.

import PostZen from '@postzen/node';

const postzen = new PostZen({
  apiKey: process.env.POSTZEN_API_KEY,
});

const { data } = await postzen.connect.createConnectUrl({
  path: { platform: 'tiktok' },
  query: {
    profileId: 'jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e',
    redirectUrl: 'https://yourapp.com/connected',
  },
});

console.log(data.authUrl); // redirect the user here
console.log(data.state);   // expires after 10 minutes
from postzen import PostZen

client = PostZen()  # reads POSTZEN_API_KEY

response = client.connect.create_connect_url(
    "tiktok",
    profile_id="jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e",
    redirect_url="https://yourapp.com/connected",
)

print(response.authUrl)  # redirect the user here
print(response.state)    # expires after 10 minutes
curl "https://api.postzen.dev/v1/connect/tiktok?profileId=jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e&redirectUrl=https://yourapp.com/connected" \
  -H "Authorization: Bearer $POSTZEN_API_KEY"

The endpoint returns { authUrl, state }. Complete the OAuth flow at authUrl before the state expires.

Connection lanes

New TikTok connections go through PostZen's TikTok for Business app. An account connected before that stays on TikTok's developer app, and keeps working exactly as it did, until its owner reconnects it. The account object reports which lane it is on: connectionLane is "business" for a TikTok for Business connection and absent otherwise.

The lane changes three things:

Earlier connectionTikTok for Business connection
Video privacyEvery level the creator allowsPublic only. A draft is the one route to a video that is not public
Photo post privacyEvery level the creator allowsEvery level the creator allows
Comments in the inboxNot availableAvailable in the dashboard, the API, and the MCP server
AnalyticsViews, likes, comments, and sharesAdds reach, saves, watch time, completion rate, traffic sources, and audience insights

Reconnecting an account is what moves it to the TikTok for Business app:

  • Reconnecting keeps the account. The account ID, its profile, its post history, and its analytics stay in place. Reconnect from the Connections page, or request a connect URL with the account's accountId.
  • Connecting an account the profile already has refreshes it. When the TikTok account you authorize has the same display name as exactly one TikTok account already in that profile, PostZen moves that account instead of adding a second copy. No match, or more than one, adds a new account.
  • The account's TikTok ID changes. TikTok issues a different ID to each app, so providerAccountId is new after the move. PostZen's own account ID does not change.
  • Scheduled videos that are not public will fail. A video scheduled as friends-only or private cannot be published after the move. The redirect back to your app carries affected_scheduled_videos with how many there are, so you can switch them to public or to a draft first.
  • A post that is publishing blocks the move. Wait for it to finish, then reconnect.

Accept every permission on TikTok's consent screen. If the posting permissions are left out, nothing changes on the account and the redirect carries error=missing_tiktok_permissions with the missing ones in missing_scopes.

Quick start

Publish a video now by passing one public video URL and a privacy level. Replace the account ID with the ID of your connected TikTok account.

const { data } = await postzen.posts.createPost({
  body: {
    content: 'A quick look at the finished project.',
    publishNow: true,
    mediaItems: [
      { url: 'https://cdn.example.com/project-tour.mp4' },
    ],
    platforms: [
      {
        platform: 'tiktok',
        accountId: 'jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e',
        settings: { privacyLevel: 'publicToEveryone' },
      },
    ],
  },
});

console.log(data.post._id);
response = client.posts.create_post(
    content="A quick look at the finished project.",
    publish_now=True,
    media_items=[
        {"url": "https://cdn.example.com/project-tour.mp4"},
    ],
    platforms=[
        {
            "platform": "tiktok",
            "account_id": "jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e",
            "settings": {"privacy_level": "publicToEveryone"},
        },
    ],
)

print(response.post.field_id)
curl -X POST https://api.postzen.dev/v1/posts \
  -H "Authorization: Bearer $POSTZEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "A quick look at the finished project.",
    "publishNow": true,
    "mediaItems": [
      { "url": "https://cdn.example.com/project-tour.mp4" }
    ],
    "platforms": [
      {
        "platform": "tiktok",
        "accountId": "jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e",
        "settings": { "privacyLevel": "publicToEveryone" }
      }
    ]
  }'

Use scheduledFor with an ISO-8601 timestamp at least 60 seconds in the future instead of publishNow to schedule the post.

Content types

Video posts

A video post requires exactly one video. Its caption can contain up to 2,200 characters, and the video file can be no larger than 4 GB. The TikTok settings let you choose the privacy level and control comments, duets, and stitches.

const { data } = await postzen.posts.createPost({
  body: {
    content: 'Behind the scenes from today\'s shoot.',
    scheduledFor: '2026-07-16T18:00:00Z',
    mediaItems: [
      { url: 'https://cdn.example.com/behind-the-scenes.mp4' },
    ],
    platforms: [
      {
        platform: 'tiktok',
        accountId: 'jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e',
        settings: {
          privacyLevel: 'publicToEveryone',
          allowComments: true,
          allowDuet: false,
          allowStitch: false,
        },
      },
    ],
  },
});

console.log(data.post._id);
response = client.posts.create_post(
    content="Behind the scenes from today's shoot.",
    scheduled_for="2026-07-16T18:00:00Z",
    media_items=[
        {"url": "https://cdn.example.com/behind-the-scenes.mp4"},
    ],
    platforms=[
        {
            "platform": "tiktok",
            "account_id": "jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e",
            "settings": {
                "privacy_level": "publicToEveryone",
                "allow_comments": True,
                "allow_duet": False,
                "allow_stitch": False,
            },
        },
    ],
)

print(response.post.field_id)
curl -X POST https://api.postzen.dev/v1/posts \
  -H "Authorization: Bearer $POSTZEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Behind the scenes from today'"'"'s shoot.",
    "scheduledFor": "2026-07-16T18:00:00Z",
    "mediaItems": [
      { "url": "https://cdn.example.com/behind-the-scenes.mp4" }
    ],
    "platforms": [
      {
        "platform": "tiktok",
        "accountId": "jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e",
        "settings": {
          "privacyLevel": "publicToEveryone",
          "allowComments": true,
          "allowDuet": false,
          "allowStitch": false
        }
      }
    ]
  }'

Photo posts

TikTok allows up to 35 images in a photo post, while a PostZen create-post request accepts up to 10 mediaItems. A photo post can have a title of up to 90 characters. TikTok rejects GIFs, and the post cannot include a video.

const { data } = await postzen.posts.createPost({
  body: {
    title: 'A look inside the studio',
    content: 'A few details from this week\'s work.',
    publishNow: true,
    mediaItems: [
      { url: 'https://cdn.example.com/studio-1.jpg' },
      { url: 'https://cdn.example.com/studio-2.jpg' },
    ],
    platforms: [
      {
        platform: 'tiktok',
        accountId: 'jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e',
        settings: {
          privacyLevel: 'mutualFollowFriends',
          allowComments: true,
        },
      },
    ],
  },
});

console.log(data.post._id);
response = client.posts.create_post(
    title="A look inside the studio",
    content="A few details from this week's work.",
    publish_now=True,
    media_items=[
        {"url": "https://cdn.example.com/studio-1.jpg"},
        {"url": "https://cdn.example.com/studio-2.jpg"},
    ],
    platforms=[
        {
            "platform": "tiktok",
            "account_id": "jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e",
            "settings": {
                "privacy_level": "mutualFollowFriends",
                "allow_comments": True,
            },
        },
    ],
)

print(response.post.field_id)
curl -X POST https://api.postzen.dev/v1/posts \
  -H "Authorization: Bearer $POSTZEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "A look inside the studio",
    "content": "A few details from this week'"'"'s work.",
    "publishNow": true,
    "mediaItems": [
      { "url": "https://cdn.example.com/studio-1.jpg" },
      { "url": "https://cdn.example.com/studio-2.jpg" }
    ],
    "platforms": [
      {
        "platform": "tiktok",
        "accountId": "jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e",
        "settings": {
          "privacyLevel": "mutualFollowFriends",
          "allowComments": true
        }
      }
    ]
  }'

Media requirements

Video

RequirementValue
Videos per postExactly 1
Maximum file size4 GB
PostZen presigned upload typesmp4, mpeg, quicktime, avi, webm, m4v
Caption lengthUp to 2,200 characters
Images in the same postNot allowed
Recommended orientation9:16 vertical
Recommended resolution1080×1920

Photos

RequirementValue
Images per postTikTok allows up to 35; a PostZen request accepts up to 10 mediaItems
PostZen presigned upload typesjpeg, jpg, png, webp, gif
GIFsRejected
Title lengthUp to 90 characters
Videos in the same postNot allowed
Recommended orientation9:16 vertical
Recommended resolution1080×1920

PostZen accepts up to 10 mediaItems in a create-post request. It downloads and re-hosts external media URLs up to 100 MB. Presigned uploads can be up to 5 GB, subject to TikTok's 4 GB video limit.

Platform settings

Put TikTok settings in the settings object for the TikTok target inside platforms:

platforms: [
  {
    platform: 'tiktok',
    accountId: 'jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e',
    settings: {
      privacyLevel: 'publicToEveryone',
      allowComments: true,
      allowDuet: false,
      allowStitch: false,
    },
  },
]
SettingTypeNotes
privacyLevel"publicToEveryone" | "mutualFollowFriends" | "followerOfCreator" | "selfOnly"Required unless uploadAsDraft: true. Available levels depend on the creator's account settings. A video on a TikTok for Business connection accepts only publicToEveryone; photo posts accept every level.
allowCommentsbooleanEnables or disables comments.
allowDuetbooleanEnables or disables duets for video posts.
allowStitchbooleanEnables or disables stitches for video posts.
disableCommentbooleanInverse comment toggle.
disableDuetbooleanInverse duet toggle.
disableStitchbooleanInverse stitch toggle.
videoCoverTimestampMsnumberSelects the video frame used as the cover.
uploadAsDraftbooleanSends the post to the creator's TikTok inbox as a draft instead of publishing it.
brandContentTogglebooleanDiscloses a paid partnership.
brandOrganicTogglebooleanDiscloses promotion of the creator's own brand.
isAigcbooleanLabels the post as AI-generated. Required by TikTok for realistic AI-made content. Also accepted as is_aigc or aiGenerated.

Branded content must be public or visible to friends. A request with brandContentToggle: true and privacyLevel: "selfOnly" fails validation.

AI-generated content

TikTok's Community Guidelines require a label on realistic AI-generated video, images, or audio. Set isAigc: true and TikTok adds the "Creator labeled as AI-generated" label when the post goes live. The label applies to video posts on every connection. Photo posts carry it only on an earlier connection, since TikTok's Business photo endpoint has no AI-generated field.

platforms: [
  {
    platform: 'tiktok',
    accountId: 'jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e',
    settings: {
      privacyLevel: 'publicToEveryone',
      allowComments: true,
      isAigc: true,
    },
  },
]

The label is set at upload and cannot be added or removed afterwards, by you or by TikTok's API. A post published without isAigc: true stays unlabelled, and TikTok may flag it for missing disclosure.

Drafts cannot carry the label. TikTok ignores isAigc when uploadAsDraft is true, so the creator turns on "AI-generated content" in the TikTok app before posting the draft. The same applies to a photo post on a TikTok for Business connection.

A TikTok post's platformPostId and platformPostUrl appear only once TikTok makes the post public, usually within a few minutes of publishing, so the post.platform.published webhook for a TikTok target carries neither; fetch the post to read them. Drafts get them when the creator posts the draft, and photo posts get an id but no URL.

Comments

A TikTok for Business connection brings the account's comments into the PostZen inbox: in the dashboard at app.postzen.dev/inbox, through the REST API under /v1/inbox/comments, and as tools on the MCP server. You can list the account's posts with their comment counts, read comments and replies, comment on a post, and reply to, like, hide, and delete comments.

  • Hide other people's comments, delete your own. TikTok lets an account delete only the comments it wrote. Anyone else's comment can be hidden instead, and each comment's canHide and canDelete flags say which applies.
  • Replies are one level deep. Replying to a reply posts under its top-level comment.
  • Repeated replies can be hidden by TikTok. Sending many near-identical replies in a short time is treated as spam.
curl "https://api.postzen.dev/v1/inbox/comments/POST_ID?accountId=jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e" \
  -H "Authorization: Bearer $POSTZEN_API_KEY"

A comment automation can answer keyword comments for you: when a comment on your video matches, PostZen posts a public reply under it.

Private replies, which send a DM to the commenter, are not available on TikTok. An account on an earlier connection answers 400 platformUnsupported until it is reconnected. See Inbox for the endpoints and how the comments inbox works.

Analytics and insights

PostZen analytics is live for TikTok, including video metrics, follower counts, and best-time-to-post suggestions. What an account reports depends on its connection lane.

DataEarlier connectionTikTok for Business connection
Views, likes, comments, sharesYesYes
Reach and savesNoYes
Average and total watch time, completion rate, new followersNoYes
Traffic sources, retention curve, viewer gender and country, per postNoYes
Daily profile views, video views, and follower gains and lossesNoYes
Audience age, gender, country, and active hoursNoYes

On a TikTok for Business connection:

  • Post metrics arrive on GET /v1/analytics. Each post's analytics object adds reach, saves, avgWatchTimeMs, totalWatchTimeMs, completionRate (0 to 100), and newFollowers. Request a single post with postId and analytics.insights adds its traffic sources, retention curve, and viewer gender and country.
  • Account insights arrive on GET /v1/analytics/account-insights with an accountId. It returns daily activity, totals for the range, the audience breakdown, and an availability object that says why a section is empty.
curl "https://api.postzen.dev/v1/analytics/account-insights?accountId=jh72r5nqk9wx3v8m1t4cz6bs0fy5dg3e&fromDate=2026-10-01&toDate=2026-10-31" \
  -H "Authorization: Bearer $POSTZEN_API_KEY"

What to expect from TikTok's numbers:

  • They lag by one to two days. TikTok publishes insights 24 to 48 hours after the fact, so the most recent days fill in later.
  • History starts 60 days before the first sync. TikTok offers 60 days of daily account data, and only from the day the creator turned on analytics in the TikTok app.
  • Audience data needs 100 followers. Below that, availability.audience is insufficient_followers.
  • A missing field means TikTok did not report it. Some daily metrics exist only for accounts with TikTok's Advanced Access or a Verified Business Account. PostZen leaves those out instead of returning 0.
  • Existing posts fill in after a reconnect. Posts from the last year are refreshed over the following hours. Reach and saves count from the reconnect onward in daily totals.
  • TikTok reports public videos only, and stops updating a post a year after it was published.

An account on an earlier connection reports views, likes, comments, and shares, and GET /v1/analytics/account-insights answers platformUnsupported for it. Reconnect the account to add the rest.

What you can't do

PostZen does not yet support these TikTok capabilities:

  • Publish a text-only post.
  • Add music from TikTok's music library.
  • Create a duet or stitch. The settings above control whether other users may duet or stitch a video.
  • Use TikTok effects or filters.
  • Go live.
  • Edit a published post.
  • Publish a friends-only or private video on a TikTok for Business connection. Send it as a draft instead.
  • Read or manage DMs and inbox messages.
  • Send a private reply to a commenter.

Common errors

ErrorMeaningFix
Missing privacyLevelTikTok requires a privacy level unless uploadAsDraft is true.Add an available privacyLevel, or set uploadAsDraft: true.
Privacy level unavailableThe creator's account does not allow the requested level.Choose a privacy level available to that creator.
"TikTok videos from this account can only be posted publicly"The account is on a TikTok for Business connection, where a video is public or a draft.Set privacyLevel: "publicToEveryone", or set uploadAsDraft: true.
Branded content set to privateTikTok rejects brandContentToggle: true with privacyLevel: "selfOnly".Use a public or friends-visible privacy level that the creator allows.
AI-generated post went out unlabelledisAigc was omitted, or the post was sent as a draft, where TikTok offers no label field.Send isAigc: true on a direct post. The label cannot be added after publishing, so republish if the post must carry it.
GIF attached to a photo postTikTok rejects GIFs in photo posts.Remove the GIF from mediaItems.
Video over 4 GBThe video exceeds TikTok's maximum file size.Reduce the video to 4 GB or less.
Photo title over 90 charactersThe title exceeds TikTok's photo post limit.Shorten the title to 90 characters or fewer.
402 while connectingThe Free plan's 2 included accounts are already in use.Upgrade your plan, then start the connect flow again.
OAuth state expiredThe connect flow was not completed within 10 minutes.Request a new connect URL and complete OAuth within 10 minutes.
error=missing_tiktok_permissionsA posting permission was left unticked on TikTok's consent screen.Connect again and accept every permission.
error=tiktok_account_mismatchA reconnect was approved while signed in to a different TikTok account.Sign in to the account being reconnected, or connect the other account as a new connection.
error=tiktok_publish_in_progressThe account has a post that is still publishing.Wait for the post to finish, then reconnect.
error=tiktok_account_already_connectedThe TikTok account is already connected as another account in PostZen.Use the existing connection, or disconnect it first.

On this page