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
| Requirement | TikTok limit |
|---|---|
| Video post media | Exactly 1 video |
| Photo post media | TikTok allows up to 35 images; a PostZen request accepts up to 10 mediaItems |
| Caption | Up to 2,200 characters for video posts |
| Photo post title | Up to 90 characters |
| Video file size | Up to 4 GB |
| PostZen presigned image upload types | jpeg, jpg, png, webp, gif; TikTok rejects GIF photo posts |
| PostZen presigned video upload types | mp4, mpeg, quicktime, avi, webm, m4v |
| GIF photo posts | Not supported |
| Mixed image and video posts | Not supported |
| Recommended layout | 9:16 vertical at 1080×1920 |
| Immediate publishing | Supported with publishNow |
| Scheduling | Supported with scheduledFor |
| Draft upload | Supported with settings.uploadAsDraft |
| Video privacy | Public or draft on a TikTok for Business connection; every level the creator allows on an earlier connection. See Connection lanes |
| Photo post privacy | Every level the creator allows |
| Posting limit | 15 videos and 15 photo posts a day per account, and 6 a minute, on a TikTok for Business connection |
| AI-generated label | Supported 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_KEYin 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
privacyLevelunless you setuploadAsDraft: true. The available privacy levels depend on the creator's TikTok account settings, and a video on a TikTok for Business connection can only bepublicToEveryone. - 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 minutesfrom 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 minutescurl "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 connection | TikTok for Business connection | |
|---|---|---|
| Video privacy | Every level the creator allows | Public only. A draft is the one route to a video that is not public |
| Photo post privacy | Every level the creator allows | Every level the creator allows |
| Comments in the inbox | Not available | Available in the dashboard, the API, and the MCP server |
| Analytics | Views, likes, comments, and shares | Adds 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
providerAccountIdis 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_videoswith 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
| Requirement | Value |
|---|---|
| Videos per post | Exactly 1 |
| Maximum file size | 4 GB |
| PostZen presigned upload types | mp4, mpeg, quicktime, avi, webm, m4v |
| Caption length | Up to 2,200 characters |
| Images in the same post | Not allowed |
| Recommended orientation | 9:16 vertical |
| Recommended resolution | 1080×1920 |
Photos
| Requirement | Value |
|---|---|
| Images per post | TikTok allows up to 35; a PostZen request accepts up to 10 mediaItems |
| PostZen presigned upload types | jpeg, jpg, png, webp, gif |
| GIFs | Rejected |
| Title length | Up to 90 characters |
| Videos in the same post | Not allowed |
| Recommended orientation | 9:16 vertical |
| Recommended resolution | 1080×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,
},
},
]| Setting | Type | Notes |
|---|---|---|
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. |
allowComments | boolean | Enables or disables comments. |
allowDuet | boolean | Enables or disables duets for video posts. |
allowStitch | boolean | Enables or disables stitches for video posts. |
disableComment | boolean | Inverse comment toggle. |
disableDuet | boolean | Inverse duet toggle. |
disableStitch | boolean | Inverse stitch toggle. |
videoCoverTimestampMs | number | Selects the video frame used as the cover. |
uploadAsDraft | boolean | Sends the post to the creator's TikTok inbox as a draft instead of publishing it. |
brandContentToggle | boolean | Discloses a paid partnership. |
brandOrganicToggle | boolean | Discloses promotion of the creator's own brand. |
isAigc | boolean | Labels 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
canHideandcanDeleteflags 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.
| Data | Earlier connection | TikTok for Business connection |
|---|---|---|
| Views, likes, comments, shares | Yes | Yes |
| Reach and saves | No | Yes |
| Average and total watch time, completion rate, new followers | No | Yes |
| Traffic sources, retention curve, viewer gender and country, per post | No | Yes |
| Daily profile views, video views, and follower gains and losses | No | Yes |
| Audience age, gender, country, and active hours | No | Yes |
On a TikTok for Business connection:
- Post metrics arrive on
GET /v1/analytics. Each post'sanalyticsobject addsreach,saves,avgWatchTimeMs,totalWatchTimeMs,completionRate(0 to 100), andnewFollowers. Request a single post withpostIdandanalytics.insightsadds its traffic sources, retention curve, and viewer gender and country. - Account insights arrive on
GET /v1/analytics/account-insightswith anaccountId. It returns daily activity, totals for the range, the audience breakdown, and anavailabilityobject 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.audienceisinsufficient_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
| Error | Meaning | Fix |
|---|---|---|
Missing privacyLevel | TikTok requires a privacy level unless uploadAsDraft is true. | Add an available privacyLevel, or set uploadAsDraft: true. |
| Privacy level unavailable | The 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 private | TikTok rejects brandContentToggle: true with privacyLevel: "selfOnly". | Use a public or friends-visible privacy level that the creator allows. |
| AI-generated post went out unlabelled | isAigc 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 post | TikTok rejects GIFs in photo posts. | Remove the GIF from mediaItems. |
| Video over 4 GB | The video exceeds TikTok's maximum file size. | Reduce the video to 4 GB or less. |
| Photo title over 90 characters | The title exceeds TikTok's photo post limit. | Shorten the title to 90 characters or fewer. |
402 while connecting | The Free plan's 2 included accounts are already in use. | Upgrade your plan, then start the connect flow again. |
| OAuth state expired | The connect flow was not completed within 10 minutes. | Request a new connect URL and complete OAuth within 10 minutes. |
error=missing_tiktok_permissions | A posting permission was left unticked on TikTok's consent screen. | Connect again and accept every permission. |
error=tiktok_account_mismatch | A 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_progress | The account has a post that is still publishing. | Wait for the post to finish, then reconnect. |
error=tiktok_account_already_connected | The TikTok account is already connected as another account in PostZen. | Use the existing connection, or disconnect it first. |