Platforms / TikTok
TikTok API
Publish videos and photo posts to a TikTok account, or send them to its TikTok drafts.
At a glance
- Platform id
tiktok- Connects
- account
- Sign-in
- OAuth: the user approves on the platform's own page
- Post types
- Video · Photo post (1-35 JPEG/WebP) · Draft in the TikTok app (video only)
Capabilities
| Publishing | Yes |
|---|---|
| Scheduling | Yes |
| Comments | No |
| Direct messages | No |
| Mentions | No |
| Reviews | No |
| Analytics | Partly |
Required on every post
- One video, or 1 to 35 photos (never both).
- platform_data.tiktok.privacy_level on every direct post. There is no default: leaving it out fails with validation.privacy_level_required.
Options
Send these in platform_data.tiktok on the post, or flat in a target's own platform_data (the target's keys win). See Publishing.
| Key | Type | What it does |
|---|---|---|
privacy_levelrequired | PUBLIC_TO_EVERYONE | MUTUAL_FOLLOW_FRIENDS | FOLLOWER_OF_CREATOR | SELF_ONLY | Who can see the post. Required on direct posts and must be one of the creator's allowed levels (validation.invalid_privacy_level). Not used on drafts. |
post_mode | direct | inbox | direct (default) publishes. inbox sends a video to the creator's TikTok drafts; photo posts cannot be drafts (validation.post_mode). |
disable_comment | boolean | Default true when left out. |
disable_duet, disable_stitch | boolean | Videos only. Default true when left out. |
brand_content_toggle | boolean | Paid partnership. Cannot be combined with SELF_ONLY (validation.branded_content_private). |
brand_organic_toggle | boolean | Promotes the creator's own business. |
is_aigc | boolean | Videos only: marks the video as AI-generated. |
video_cover_timestamp_ms | number | Videos only: the cover frame, in milliseconds. |
pull_from_url | boolean | Videos only: TikTok downloads the file itself (its domain must be verified). Default: uploaded in chunks. |
photo_cover_index | number | Photo posts: 0-based index of the cover photo. Default 0. |
auto_add_music | boolean | Photo posts: TikTok adds recommended music. |
description | string | Photo posts: the caption, up to 4,000 characters. The post text is the photo post's title (90 characters). |
media_type | video | photo | Optional check: must match the attached media. |
Limits
- Video captions 2,200 characters. Photo post title 90 characters, description 4,000.
- Videos MP4, MOV or WebM, at least 3 seconds, up to 4 GB. Photos JPEG or WebP, up to 20 MB each.
- TikTok limits each creator to roughly 15 posts a day through apps, and its post endpoints to about 6 requests a minute per account (validation.posting_limit when TikTok says the creator is at the limit).
- This server caps each account at 25 posts an hour and 13 a day.
Text over the limit fails validation before anything is sent. The caps of this server are explained in Rate limits.
Good to know
- Connects as a creator through the Content Posting API. metadata.connection_type "business" is refused.
- The allowed privacy levels, the longest video and any comment, Duet or Stitch locks come from creator info (GET /v1/accounts/{id}/creator-info). A creator's locks in the app always win over the options.
- TikTok finishes posts after the request returns, so a target stays publishing until TikTok reports it live or failed. A draft lands in the creator's TikTok inbox to finish in the app.
- Published posts cannot be edited or deleted through TikTok's API: change or delete them in the TikTok app.
- Accounts connected before the analytics scopes (user.info.profile, user.info.stats, video.list) were added must reconnect to read analytics.
Publish with the API
curl https://api.zaynstack.com/v1/posts \
-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{
"text": "Hello from SocialWire",
"media": [{ "type": "image", "source_type": "url", "source": "https://example.com/file.jpg" }],
"platform_data": { "tiktok": { "privacy_level": "SELF_ONLY" } },
"targets": [{ "account_id": "<TikTok account id>" }],
"publish_now": true
}'An operation TikTok cannot do answers 501 resource.not_supported. Agents can do the same through the MCP server.
Connection errors
A connection that fails comes back to your redirect_uri with status=error, error=<code> and error_description, or as the error of the connect call. All codes: Connect accounts.
| Code | Meaning |
|---|---|
account.already_linked | The brand already holds a different account on this platform, or the account belongs to another brand while lock_accounts_to_brand is on. |
billing.brands_limit | No brand_id was sent, so a new brand was needed, and the plan has no room for another brand. |
Webhook events
Every platform sends the post.* and account.* events. TikTok sends no inbox events.
Not supported yet
- Comments, mentions and DMs: they need TikTok API for Business, a separate app and review that this server does not use.
- Business connections (metadata.connection_type "business").
- Photo posts as drafts.
- Editing or deleting published posts.
Developer setup (self-hosting)
Only the operator of this server does this, once. Users then just click Connect.
- Create an app at developers.tiktok.com → Manage apps.
- Add the products Login Kit and Content Posting API (enable Direct Post), and add the scopes listed below (user.info.profile, user.info.stats and video.list feed the analytics).
- Add the Callback address below as a Redirect URI and verify your domain (URL prefix verification): TikTok pulls photos, and videos sent with pull_from_url, from that domain.
- Fill in app icon, description, Terms of Service URL and Privacy Policy URL.
- Put the client key and secret into TIKTOK_CLIENT_KEY / TIKTOK_CLIENT_SECRET.
- Callback address
https://api.zaynstack.com/api/connect/tiktok/callback- Webhook address
https://api.zaynstack.com/api/hooks/tiktok- Server variables
TIKTOK_CLIENT_KEY, TIKTOK_CLIENT_SECRET- Developer console
- TikTok developer console
Permissions requested
user.info.basicuser.info.profileuser.info.statsvideo.listvideo.publishvideo.upload
When a reconnect grants fewer permissions than before, an account.updated event with change permissions_reduced is sent. Accounts connected before a permission was added keep working but must reconnect to use the features it unlocks.
Before anyone can connect (review)
- Submit the app for review (demo video of the whole connect → post flow on your real domain).
- Then request the Content Posting API audit; until it passes every post is forced to private (SELF_ONLY) and only private accounts can post.
Typical wait: App review a few days; posting audit 1-4 weeks. Until then the app works for your own accounts and the testers you add in the console.