TikTok API - Upload Video via REST API
Agency client posts: use the separate Company platform settings contract. The personal API examples below keep their existing shapes and upload workflows.
Upload videos to TikTok programmatically using the Publora REST API. A simpler alternative to the official TikTok Developer API, TikTok Business SDK, or TikAPI.
TikTok API Overview
Publora provides a unified REST API for uploading and publishing videos to TikTok with granular privacy and interaction controls. No need to manage complex TikTok OAuth flows, handle video processing, or navigate TikTok's developer portal requirements.
Why Use Publora Instead of TikTok Developer API / TikTok Business SDK?
| Feature | Publora API | TikTok Developer API |
|---|---|---|
| Authentication | Single API key | Complex OAuth 2.0 flow |
| Video upload | Simple REST endpoint | Multi-step upload process |
| App approval | Not required | TikTok app review required |
| Multi-platform | Post to 10 platforms | TikTok only |
| Setup time | 5 minutes | Weeks (app review) |
| Privacy controls | Full support | Full support |
Keywords: TikTok API, TikTok upload video API, TikTok posting API, TikTok video API, upload to TikTok programmatically, TikTok bot API, TikTok automation API, TikTok REST API, TikTok developer API, TikTok content API, post video to TikTok API
Platform ID Format
tiktok-{openId}Where {openId} is the TikTok open_id assigned during account connection via OAuth. This is an app-scoped identifier (not the user's public TikTok user ID).
Requirements
- A TikTok account connected via OAuth through the Publora dashboard
- API key from Publora
- Media is required — either a video or a photo carousel of up to 35 images (TikTok has no text-only posts)
Supported Content
| Type | Supported | Limits |
|---|---|---|
| Text only | No | TikTok requires media (a video or photo) |
| Images | Yes | Photo carousel, up to 35 images (JPEG, PNG, WebP) |
| Videos | Yes | MP4, MOV, or WebM; minimum 23 FPS |
Platform-Specific Settings
TikTok has extensive publishing settings that you can control through the platformSettings object:
{
"platformSettings": {
"tiktok": {
"viewerSetting": "PUBLIC_TO_EVERYONE",
"allowComments": true,
"allowDuet": false,
"allowStitch": false,
"commercialContent": false,
"brandOrganic": false,
"brandedContent": false,
"aiGenerated": false
}
}
}Viewer Settings
Default:
PUBLIC_TO_EVERYONE. When you create a post via the REST API without specifyingviewerSetting, Publora appliesPUBLIC_TO_EVERYONE. A value is effectively required — an empty string is rejected with "TikTok requires selecting who can view your post" — so always setviewerSettingexplicitly in yourplatformSettings.tiktokobject.The viewer settings an account can actually use are determined by TikTok from that account's own configuration. Public accounts support all four levels below. If the connected account is private, TikTok limits it to
SELF_ONLYand rejects other values for that account — switch the account to public in the TikTok app to unlock the full range.
| Value | Description |
|---|---|
PUBLIC_TO_EVERYONE |
Anyone can view the video |
MUTUAL_FOLLOW_FRIENDS |
Only mutual followers can view |
FOLLOWER_OF_CREATOR |
Only your followers can view |
SELF_ONLY |
Only you can view (draft-like behavior) |
Interaction Settings
Each flag is direct:
trueallows the interaction,falseblocks it. All three default tofalse; enable them only after the creator explicitly opts in.Note: Duet and Stitch apply to video posts only. TikTok also honors the account's own permissions — if a creator has disabled Duet, Stitch, or comments at the account level, that takes precedence over the request.
| Setting | Type | Default | Description |
|---|---|---|---|
allowComments |
boolean | false |
Allow viewers to comment |
allowDuet |
boolean | false |
Allow viewers to create Duets |
allowStitch |
boolean | false |
Allow viewers to Stitch your video |
Automatic Music for Photo Posts
For a photo carousel, opt in with the optional boolean
platformSettings.tiktok.autoAddMusic:
{
"platformSettings": {
"tiktok": {
"viewerSetting": "PUBLIC_TO_EVERYONE",
"autoAddMusic": true
}
}
}TikTok will automatically choose the music. You cannot select or preview a specific track in Publora. Choosing or uploading a song, searching a music catalogue and editing video soundtracks are not supported by this setting.
| Value | Behavior |
|---|---|
true |
Ask TikTok to add recommended music to a photo Direct Post. |
false |
Disable music; send false for photos. Allowed when switching to video, which never sends the parameter. |
| Omitted | Preserve existing behavior; Publora does not silently enable music. |
Use this field on personal REST create-post/update-post and MCP
create_post/update_post. Agency drafts accept it through Company REST and
company_create_post/company_update_post inside draft.platformSettings;
see Company settings.
Draft saving, loading, editing, duplication and scheduling preserve the value.
Attaching known video/document media automatically clears a previously enabled
photo-music setting. For personal update-post/update_post media appends, this
cleanup applies when autoAddMusic is omitted; explicit true still fails
validation with non-photo media.
Enable this option only for photo Direct Post: true with known non-photo
media fails validation. Send false to disable music when switching a draft to
video. Incomplete drafts without media remain allowed. The field accepts JSON booleans only; strings such as "true",
numbers and null are rejected. Publora maps an explicitly supplied value to
TikTok's post_info.auto_add_music on /v2/post/publish/content/init/, and never
sends it in video publishing requests. It uses the existing video.publish
permission, with no additional OAuth scope.
Changing this publishing setting invalidates an existing Agency client approval. Request approval of the changed draft before scheduling/publishing when client review is required.
Reference: TikTok photo Direct Post API.
Commercial Content Settings
| Setting | Type | Default | Description |
|---|---|---|---|
commercialContent |
boolean | false |
Whether this is commercial content |
brandOrganic |
boolean | false |
Organic brand promotion (your own brand) |
brandedContent |
boolean | false |
Paid partnership or sponsored content |
Note: If
commercialContentistrue, then at least one ofbrandOrganicorbrandedContentmust also betrue. Publora will return a validation error ifcommercialContentis enabled without specifying which type of commercial content applies.
AI-Generated Content Disclosure
| Setting | Type | Default | Description |
|---|---|---|---|
aiGenerated |
boolean | false |
Self-disclose realistic AI-generated video or images; TikTok shows its "Creator labeled as AI-generated" label (is_aigc) |
TikTok requires the label for realistic AI-generated video or images; a missing disclosure risks removal or loss of For You eligibility. Publora sends the value as is_aigc: inside post_info for video Direct Post (always present, false by default) and at the top level of the photo content/init request (only when true). REST accepts the usual string encodings ("true", "1", "yes", "on" and their negatives); MCP create_post/update_post and the Company API accept JSON booleans only. Agency drafts take it inside draft.platformSettings.tiktok, and changing it invalidates an existing client approval. The same field exists on Instagram, YouTube and X — see AI-Generated Content Disclosure.
Examples
Post a Video
JavaScript (fetch)
const response = await fetch('https://api.publora.com/api/v1/create-post', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-publora-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
content: 'How we built our startup in 60 seconds #startup #tech #coding',
platforms: ['tiktok-99887766'],
platformSettings: {
tiktok: {
viewerSetting: 'PUBLIC_TO_EVERYONE',
allowComments: true,
allowDuet: false,
allowStitch: false,
commercialContent: false,
brandOrganic: false,
brandedContent: false
}
}
})
});
const data = await response.json();
console.log(data);
// Response: { "success": true, "postGroupId": "abc123...", "scheduledTime": null }Python (requests)
import requests
response = requests.post(
'https://api.publora.com/api/v1/create-post',
headers={
'Content-Type': 'application/json',
'x-publora-key': 'YOUR_API_KEY'
},
json={
'content': 'How we built our startup in 60 seconds #startup #tech #coding',
'platforms': ['tiktok-99887766'],
'platformSettings': {
'tiktok': {
'viewerSetting': 'PUBLIC_TO_EVERYONE',
'allowComments': True,
'allowDuet': False,
'allowStitch': False,
'commercialContent': False,
'brandOrganic': False,
'brandedContent': False
}
}
}
)
data = response.json()
print(data)
# Response: { "success": true, "postGroupId": "abc123...", "scheduledTime": null }cURL
curl -X POST https://api.publora.com/api/v1/create-post \
-H "Content-Type: application/json" \
-H "x-publora-key: YOUR_API_KEY" \
-d '{
"content": "How we built our startup in 60 seconds #startup #tech #coding",
"platforms": ["tiktok-99887766"],
"platformSettings": {
"tiktok": {
"viewerSetting": "PUBLIC_TO_EVERYONE",
"allowComments": true,
"allowDuet": false,
"allowStitch": false,
"commercialContent": false,
"brandOrganic": false,
"brandedContent": false
}
}
}'
# Response: { "success": true, "postGroupId": "abc123...", "scheduledTime": null }Node.js (axios)
const axios = require('axios');
const response = await axios.post('https://api.publora.com/api/v1/create-post', {
content: 'How we built our startup in 60 seconds #startup #tech #coding',
platforms: ['tiktok-99887766'],
platformSettings: {
tiktok: {
viewerSetting: 'PUBLIC_TO_EVERYONE',
allowComments: true,
allowDuet: false,
allowStitch: false,
commercialContent: false,
brandOrganic: false,
brandedContent: false
}
}
}, {
headers: {
'Content-Type': 'application/json',
'x-publora-key': 'YOUR_API_KEY'
}
});
console.log(response.data);
// Response: { "success": true, "postGroupId": "abc123...", "scheduledTime": null }Note: TikTok requires media — a video or a photo carousel. First create the post, then upload your media using the media upload workflow with the returned
postGroupId.
Post a Private Video with Restricted Interactions
JavaScript (fetch)
const response = await fetch('https://api.publora.com/api/v1/create-post', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-publora-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
content: 'Preview of our upcoming feature for close friends only',
platforms: ['tiktok-99887766'],
platformSettings: {
tiktok: {
viewerSetting: 'MUTUAL_FOLLOW_FRIENDS',
allowComments: true,
allowDuet: false,
allowStitch: false,
commercialContent: false,
brandOrganic: false,
brandedContent: false
}
}
})
});
const data = await response.json();
console.log(data);
// Response: { "success": true, "postGroupId": "abc123...", "scheduledTime": null }Python (requests)
import requests
response = requests.post(
'https://api.publora.com/api/v1/create-post',
headers={
'Content-Type': 'application/json',
'x-publora-key': 'YOUR_API_KEY'
},
json={
'content': 'Preview of our upcoming feature for close friends only',
'platforms': ['tiktok-99887766'],
'platformSettings': {
'tiktok': {
'viewerSetting': 'MUTUAL_FOLLOW_FRIENDS',
'allowComments': True,
'allowDuet': False,
'allowStitch': False,
'commercialContent': False,
'brandOrganic': False,
'brandedContent': False
}
}
}
)
data = response.json()
print(data)
# Response: { "success": true, "postGroupId": "abc123...", "scheduledTime": null }cURL
curl -X POST https://api.publora.com/api/v1/create-post \
-H "Content-Type: application/json" \
-H "x-publora-key: YOUR_API_KEY" \
-d '{
"content": "Preview of our upcoming feature for close friends only",
"platforms": ["tiktok-99887766"],
"platformSettings": {
"tiktok": {
"viewerSetting": "MUTUAL_FOLLOW_FRIENDS",
"allowComments": true,
"allowDuet": false,
"allowStitch": false,
"commercialContent": false,
"brandOrganic": false,
"brandedContent": false
}
}
}'
# Response: { "success": true, "postGroupId": "abc123...", "scheduledTime": null }Node.js (axios)
const axios = require('axios');
const response = await axios.post('https://api.publora.com/api/v1/create-post', {
content: 'Preview of our upcoming feature for close friends only',
platforms: ['tiktok-99887766'],
platformSettings: {
tiktok: {
viewerSetting: 'MUTUAL_FOLLOW_FRIENDS',
allowComments: true,
allowDuet: false,
allowStitch: false,
commercialContent: false,
brandOrganic: false,
brandedContent: false
}
}
}, {
headers: {
'Content-Type': 'application/json',
'x-publora-key': 'YOUR_API_KEY'
}
});
console.log(response.data);
// Response: { "success": true, "postGroupId": "abc123...", "scheduledTime": null }Platform Quirks
- Media required: TikTok does not support text-only posts; attach either a photo carousel (up to 35 images) or one video.
- Minimum 23 FPS: Videos must have a frame rate of at least 23 frames per second. Videos below this threshold will be rejected by TikTok.
- Supported formats: Publora's scheduling validator accepts MP4, MOV, and WebM. A presigned URL can be issued for a broader
video/*MIME type, but that upload-layer acceptance does not make AVI or MKV publishable. - Commercial content disclosure: If your video promotes a brand or is part of a paid partnership, you must set the appropriate commercial content flags. Failing to do so may violate TikTok's community guidelines.
- AI-generated content disclosure: Set
aiGenerated: truefor realistic AI-generated video or images so TikTok applies its AI-generated label; undisclosed AI content risks removal or loss of For You eligibility. See AI-Generated Content Disclosure. - Brand content dependencies: Setting
commercialContenttotruerequires at least one ofbrandOrganicorbrandedContentto also betrue. Publora will return a validation error ifcommercialContentis enabled without specifying which type applies. - Viewer setting restrictions: Some viewer settings may limit the interaction options available. For example,
SELF_ONLYposts cannot receive comments from others. - Processing time: TikTok videos may take some time to process after upload. The post may not appear immediately on the profile.
Creator Info
Before publishing, you can query the connected TikTok account's capabilities (max video duration, whether comments/duet/stitch are allowed by the creator's settings, etc.) using the creator info endpoint.
Endpoint: POST /auth/tiktok/get-creator-info
Important: This is a dashboard-only endpoint that requires session authentication. It is not available as a public API endpoint and cannot be called with API key (
x-publora-key) authentication. It is listed here for reference only.
| Parameter | Type | Required | Description |
|---|---|---|---|
platformId |
string | Yes | Your TikTok platform ID (e.g., tiktok-abc123def) |
cURL (session auth required)
curl -X POST https://api.publora.com/auth/tiktok/get-creator-info \
-H "Content-Type: application/json" \
--cookie "session=YOUR_SESSION_COOKIE" \
-d '{
"platformId": "tiktok-abc123def"
}'The response includes the creator's available privacy levels, whether comments/duet/stitch can be toggled, and the maximum video duration allowed for the account.
API Limits
These limits apply specifically to the TikTok Content Posting API and may differ from native TikTok app limits.
Character Limit
| Element | API Limit | Native App Limit |
|---|---|---|
| Video caption | 2,200 characters | 4,000 characters |
| Hashtags | Included in caption character count | Included in caption character count |
Video Limits
| Specification | API Limit | Native App Limit |
|---|---|---|
| Maximum duration | 10 minutes (600 seconds) -- actual limit is fetched dynamically from TikTok's creator info API and may vary per account | 60 minutes |
| Minimum duration | 3 seconds | 3 seconds |
| Maximum file size | 4 GB | 4 GB |
| Supported formats | MP4, MOV, WebM | MP4, MOV, WebM |
| Minimum frame rate | 23 FPS | 23 FPS |
Rate Limits
TikTok-side posting quotas are account-dependent, may change without notice, and are not a Publora numeric contract.
Publishing Notes
- Video or photo: TikTok accepts a single video (MP4, MOV, WebM), or a photo carousel of up to 35 images (JPEG, PNG, WebP). Other image formats fail scheduling validation with
400 MEDIA_TYPE_NOT_SUPPORTED. - Privacy is account-dependent: The viewer settings available to an account are set by TikTok from that account's configuration (see Viewer Settings). Public accounts can post at any level, including
PUBLIC_TO_EVERYONE. - Rate limits: TikTok-side quotas are advisory, account-dependent, and may change; Publora does not contractually enforce a posts-per-day number.
Common Error Messages
| Error Code | Description | Solution |
|---|---|---|
spam_risk_too_many_posts |
Daily post limit reached | Wait 24 hours before posting again |
duration_check_failed |
Video duration out of range | Ensure video is between 3 seconds and your account's max duration (default 10 minutes) |
file_format_check_failed |
Unsupported media format | Use MP4, MOV, or WebM for video, or JPEG, PNG, or WebP for photos. (The message may reference '.mp4' only, but these formats are all accepted.) |
Publora is built by Creative Content Crafts, Inc. Need AI-powered content creation for LinkedIn, Threads, and X? Try Co.Actor — the best AI service for authentic thought leadership at scale.