Platform Tips

How to Schedule TikTok Posts via API: Complete Developer Guide

3362 views
Serge Bulaev
Serge Bulaev
How to Schedule TikTok Posts via API: Complete Developer Guide

TL;DR

Schedule TikTok videos via the Publora API. Covers TikTok Business account setup, video specs, media upload flow, platform settings, rate limits, and code examples in JavaScript and Python.

Why Schedule TikTok Posts Programmatically?

TikTok has over 1.5 billion monthly active users and the highest engagement rates of any social platform. Yet its API remains one of the most complex to work with — requiring app approval, managing OAuth flows, handling video processing, and navigating strict content restrictions. For developers and marketing teams trying to automate TikTok publishing, the barrier to entry is frustratingly high.

This guide shows you how to schedule TikTok posts via the Publora API — a unified REST endpoint that abstracts away TikTok's OAuth complexity, video processing requirements, and app review process. Whether you are building a social media management tool, automating content pipelines, or simply want to schedule TikTok videos from your own code, this walkthrough covers everything you need.

What you'll learn in this guide:

  • TikTok's API requirements — Business account, video specs, app audit rules
  • How to connect TikTok to Publora and get your platform ID
  • Complete code examples in JavaScript and Python for scheduling posts
  • The media upload flow — presigned URLs, video upload, processing
  • Platform quirks, rate limits, and commercial content disclosure rules

TikTok API Requirements: What You Need Before Starting

Before writing a single line of code, you need to understand what TikTok demands from API integrations. TikTok's Content Posting API has stricter requirements than most social platforms.

TikTok Account

You need a TikTok account connected via OAuth through the Publora dashboard. Unlike Instagram, TikTok does not require a Business account — personal accounts work for API posting.

Video Content Required

TikTok is a video-only platform for API publishing. No text-only posts, no image posts. Every API post must include a video file.

App Audit for Public Posts

Unaudited apps can only post private videos (SELF_ONLY). TikTok requires app review before you can publish publicly. Publora routes through an approved application.

Publora API Key

Get your API key from app.publora.com under Settings → API Keys. You'll use this as the x-publora-key header in all requests.

Critical: App Audit Requirement

If you are building directly against TikTok's API, unaudited apps can only post PRIVATE videos. Your app must pass TikTok's review process to post publicly visible content. Publora handles this by routing through an already-approved application — so posts created via Publora can be set to any visibility level.

TikTok Video Specifications

Getting the video specs right is essential. TikTok will reject uploads that do not meet its requirements, and the error messages are not always clear. Here is the complete reference for TikTok API video specifications.

Specification API Limit Native App Limit
Maximum duration 10 minutes (600s) 60 minutes
Minimum duration 3 seconds 3 seconds
Maximum file size 4 GB 4 GB
Recommended format MP4, MOV, WebM MP4, MOV, WebM
Minimum frame rate 23 FPS 23 FPS
Recommended aspect ratio 9:16 (vertical) 9:16 (vertical)
Caption length 2,200 characters 4,000 characters

9:16

Recommended aspect ratio (vertical video)

4 GB

Maximum video file size

10 min

Maximum API video duration

Duration varies by account

The 10-minute limit is the default, but the actual per-account limit is fetched dynamically from TikTok's creator info API. Some accounts may have higher or lower limits depending on their TikTok status and settings.

Connect TikTok to Publora

Connecting your TikTok account to Publora is a one-time setup done through the dashboard. Once connected, you receive a platform ID in the format tiktok-{openId} that you will use in all API calls.

  1. Open the Publora Dashboard — Navigate to app.publora.com and log in.
  2. Go to Connections — Click "Connections" in the left sidebar, then click "+ Add Connection".
  3. Select TikTok — Choose TikTok from the platform list. You will be redirected to TikTok's OAuth consent screen.
  4. Authorize the connection — Grant Publora permission to post on your behalf. TikTok will request scopes for video publishing and user info.
  5. Copy your platform ID — Once authorized, your TikTok account appears in the Connections list with its platform ID (e.g., tiktok-99887766). Note this for API calls.

Pro tip: Find your platform ID programmatically

You can also retrieve your TikTok platform ID via the List Connections API endpoint — useful for automating the setup in CI/CD pipelines or multi-account management scripts.

Scheduling TikTok Posts via Publora API

With your TikTok account connected, you can now create and schedule posts using the Publora REST API. The flow is straightforward: create the post with metadata and scheduling time, then upload the video file separately.

JavaScript Example

// Step 1: Create the post with scheduling and TikTok settings
const response = await fetch('https://api.publora.com/api/v1/create-post', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-publora-key': 'sk_YOUR_API_KEY'
  },
  body: JSON.stringify({
    content: 'How we grew from 0 to 10K followers in 30 days #growthhacking #startup #tiktokmarketing',
    platforms: ['tiktok-99887766'],
    scheduledTime: '2026-04-10T14:00:00Z',
    platformSettings: {
      tiktok: {
        viewerSetting: 'PUBLIC_TO_EVERYONE',
        allowComments: true,
        allowDuet: false,
        allowStitch: false,
        commercialContent: false,
        brandOrganic: false,
        brandedContent: false
      }
    }
  })
});

const { postGroupId } = await response.json();
console.log('Post created:', postGroupId);

// Step 2: Get presigned upload URL
const uploadRes = await fetch(
  `https://api.publora.com/api/v1/upload-media/${postGroupId}?filename=growth-story.mp4`,
  { headers: { 'x-publora-key': 'sk_YOUR_API_KEY' } }
);
const { uploadUrl } = await uploadRes.json();

// Step 3: Upload the video
const videoBuffer = fs.readFileSync('growth-story.mp4');
await fetch(uploadUrl, {
  method: 'PUT',
  headers: { 'Content-Type': 'video/mp4' },
  body: videoBuffer
});
console.log('Video uploaded! Post scheduled for', '2026-04-10T14:00:00Z');

Python Example

import requests

API_KEY = 'sk_YOUR_API_KEY'
BASE = 'https://api.publora.com/api/v1'
headers = {'Content-Type': 'application/json', 'x-publora-key': API_KEY}

# Step 1: Create the post
resp = requests.post(f'{BASE}/create-post', headers=headers, json={
    'content': 'How we grew from 0 to 10K followers in 30 days #growthhacking #startup',
    'platforms': ['tiktok-99887766'],
    'scheduledTime': '2026-04-10T14:00:00Z',
    'platformSettings': {
        'tiktok': {
            'viewerSetting': 'PUBLIC_TO_EVERYONE',
            'allowComments': True,
            'allowDuet': False,
            'allowStitch': False,
            'commercialContent': False,
            'brandOrganic': False,
            'brandedContent': False
        }
    }
})
post_group_id = resp.json()['postGroupId']
print(f'Post created: {post_group_id}')

# Step 2: Get upload URL
upload_resp = requests.get(
    f'{BASE}/upload-media/{post_group_id}?filename=growth-story.mp4',
    headers={'x-publora-key': API_KEY}
)
upload_url = upload_resp.json()['uploadUrl']

# Step 3: Upload video
with open('growth-story.mp4', 'rb') as f:
    requests.put(upload_url, headers={'Content-Type': 'video/mp4'}, data=f)
print('Video uploaded! Post scheduled.')

The Media Upload Flow

TikTok's API requires a multi-step upload process. Publora simplifies this into three steps using presigned URLs — the same flow used across all 11 supported platforms.

1

Create Post

POST /create-post returns a postGroupId

2

Get Upload URL

GET /upload-media/{id} returns a presigned URL

3

Upload Video

PUT the file to the presigned URL

The presigned URL is a temporary, signed URL that allows you to upload directly to cloud storage without going through Publora's servers. This means faster uploads and no file size limits imposed by Publora — only TikTok's own 4 GB maximum applies.

TikTok Platform Settings Deep Dive

TikTok's API provides extensive control over how your video is published. These settings are passed in the platformSettings.tiktok object when creating a post.

Viewer Settings (Privacy)

Controls who can see your published video. This setting is effectively required — omitting it will cause a validation error.

Value Who Can View Use Case
PUBLIC_TO_EVERYONE Anyone on TikTok Standard public posts
MUTUAL_FOLLOW_FRIENDS Mutual followers only Close friends content
FOLLOWER_OF_CREATOR Your followers only Exclusive content
SELF_ONLY Only you Drafts and testing

Interaction Controls

allowComments

Enable or disable comments on your video. Default: true

allowDuet

Allow others to create Duets with your video. Default: false

allowStitch

Allow others to Stitch your video into theirs. Default: false

Commercial Content Disclosure

TikTok requires disclosure when your content promotes a brand or involves paid partnerships. If commercialContent is true, you must also set at least one of the following:

brandOrganic

Set to true when you are promoting your own brand. This is organic brand promotion — no third-party payment involved.

brandedContent

Set to true when there is a paid partnership or sponsorship. This flags the video as sponsored content on TikTok.

// Example: Sponsored post with commercial content disclosure
const response = await fetch('https://api.publora.com/api/v1/create-post', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-publora-key': 'sk_YOUR_API_KEY'
  },
  body: JSON.stringify({
    content: 'Loving the new @brandname headphones! #ad #sponsored #tech',
    platforms: ['tiktok-99887766'],
    scheduledTime: '2026-04-12T16:00:00Z',
    platformSettings: {
      tiktok: {
        viewerSetting: 'PUBLIC_TO_EVERYONE',
        allowComments: true,
        allowDuet: false,
        allowStitch: false,
        commercialContent: true,
        brandOrganic: false,
        brandedContent: true  // This is a paid partnership
      }
    }
  })
});

TikTok Rate Limits and API Restrictions

TikTok enforces strict rate limits that differ significantly from other platforms. Plan your automation schedule around these constraints.

Limit Type Value Notes
Posts per day 15-20 Varies by account standing
Videos per minute Max 2 Burst limit for rapid posting
Caption length 2,200 chars Native app allows 4,000
Max file size 4 GB Same as native app
Video duration 3s - 10 min Per-account limit may vary

Common Error Messages and Solutions

Error Cause Fix
spam_risk_too_many_posts Daily limit reached Wait 24 hours
duration_check_failed Video too short/long Keep between 3s and 10 min
file_format_check_failed Unsupported format Use MP4, MOV, or WebM
unaudited_client_can_only_post_to_private App not reviewed Use Publora (approved app)

Platform Quirks You Need to Know

TikTok's API has several behaviors that can catch developers off guard. Here are the most important quirks to keep in mind.

Do

  • Always use MP4 for maximum compatibility
  • Include viewerSetting in every request — it is effectively required
  • Set commercial content flags when promoting brands
  • Test with SELF_ONLY first to verify the upload flow
  • Keep videos at 23+ FPS minimum
  • Respect the 2 videos/minute burst limit

Don't

  • Try to post images or text only — TikTok requires video
  • Upload videos below 23 FPS — they will be rejected
  • Assume the 10-minute limit applies to all accounts
  • Exceed 15-20 posts per day — the spam filter will kick in
  • Forget to handle processing time — videos may not appear instantly
  • Use AVI or MKV format — while Publora accepts them, TikTok may reject them

Video processing delay

After uploading, TikTok processes the video server-side. This means your scheduled post may not appear on the profile immediately after the publish time. Processing typically takes 30 seconds to a few minutes, but can be longer for high-resolution or long-duration videos.

Scheduling Strategy: When to Post on TikTok

TikTok's algorithm is less time-sensitive than platforms like Twitter, but posting at optimal times still improves initial engagement — which feeds into the algorithm's distribution decisions.

Best Times (General)

  • Tuesday-Thursday: 10 AM - 2 PM local
  • Friday: 5 PM - 9 PM local
  • Weekend: 11 AM - 4 PM local

Scheduling with Publora

  • Use the scheduledTime field (ISO 8601 format)
  • All times are in UTC
  • Schedule up to 30 days in advance
# Schedule a week of TikTok content
import requests
from datetime import datetime, timedelta

API_KEY = 'sk_YOUR_API_KEY'
BASE = 'https://api.publora.com/api/v1'
headers = {'Content-Type': 'application/json', 'x-publora-key': API_KEY}

videos = [
    {'file': 'day1-tutorial.mp4', 'caption': 'Day 1: Getting started #tutorial'},
    {'file': 'day2-tips.mp4', 'caption': 'Day 2: Pro tips #tips'},
    {'file': 'day3-results.mp4', 'caption': 'Day 3: Results so far #results'},
]

base_time = datetime(2026, 4, 14, 14, 0, 0)  # Monday at 2 PM UTC

for i, video in enumerate(videos):
    scheduled = (base_time + timedelta(days=i)).isoformat() + 'Z'

    # Create post
    resp = requests.post(f'{BASE}/create-post', headers=headers, json={
        'content': video['caption'],
        'platforms': ['tiktok-99887766'],
        'scheduledTime': scheduled,
        'platformSettings': {
            'tiktok': {
                'viewerSetting': 'PUBLIC_TO_EVERYONE',
                'allowComments': True,
                'allowDuet': False,
                'allowStitch': False
            }
        }
    })
    post_id = resp.json()['postGroupId']

    # Get upload URL and upload video
    upload_resp = requests.get(
        f'{BASE}/upload-media/{post_id}?filename={video["file"]}',
        headers={'x-publora-key': API_KEY}
    )
    upload_url = upload_resp.json()['uploadUrl']

    with open(video['file'], 'rb') as f:
        requests.put(upload_url, headers={'Content-Type': 'video/mp4'}, data=f)

    print(f'Scheduled: {video["caption"]} at {scheduled}')

Publora vs. Direct TikTok API Integration

If you are deciding between building directly against TikTok's Content Posting API or using Publora as a middleware layer, here is how they compare.

Publora API

  • Single API key authentication
  • No TikTok app review needed
  • Built-in scheduling
  • Post to 11 platforms simultaneously
  • Setup in 5 minutes
  • Rate limit handling included

Direct TikTok API

  • Complex OAuth 2.0 flow
  • App review required (weeks)
  • No native scheduling
  • TikTok only
  • Multi-step upload process
  • Manual rate limit tracking

Getting Started in 5 Minutes

Ready to start scheduling TikTok posts? Here is the fastest path from zero to your first scheduled video.

  1. Create a Publora account — free trial available on the Pro plan
  2. Connect TikTok — Go to Connections → Add → TikTok → Authorize via OAuth
  3. Get your API key — Settings → API Keys → Create Key (authentication docs)
  4. Create your first post — Use the JavaScript or Python examples above
  5. Upload the video — Follow the 3-step media upload flow

Start scheduling TikTok posts today

Skip TikTok's complex API setup. One API key, one endpoint, video published.

Get Started Free →

Frequently Asked Questions

Does TikTok allow scheduling posts through their API?

TikTok's Content Posting API allows creating posts programmatically, but it does not have a native scheduling feature. Publora adds scheduling on top — you set a scheduledTime in your create-post request and Publora publishes the video at that exact time. This is the same approach used by all major TikTok scheduling tools.

What video formats does TikTok's API accept?

TikTok's API accepts MP4, MOV, and WebM video formats. Publora's upload layer also accepts AVI and MKV, but TikTok may reject those on their end. For reliable publishing, always use MP4. All videos must have a minimum frame rate of 23 FPS. See the TikTok platform docs for the full specification table.

Why are my TikTok API posts only visible to me?

This happens when your TikTok app has not passed the TikTok audit review. Unaudited apps can only post PRIVATE (SELF_ONLY) videos regardless of the viewerSetting value. Publora routes through an already-approved application, so posts created via Publora can use any visibility level including PUBLIC_TO_EVERYONE.

Can I post images or text-only content to TikTok via the API?

No. TikTok is a video-only platform for API publishing. Every post created through TikTok's Content Posting API must include a video file. Text-only and image-only posts are not supported. If you want to share images, consider creating a slideshow video from them before uploading.

What is the maximum video length for TikTok API posts?

The default TikTok API limit is 10 minutes (600 seconds), but the actual per-account limit varies and is fetched dynamically from TikTok's creator info endpoint. Some accounts may have higher limits. The minimum duration is 3 seconds. Note that the native TikTok app supports up to 60 minutes — the API has lower limits.

How many TikTok posts can I publish per day via the API?

TikTok's API allows approximately 15-20 posts per day, with a maximum of 2 videos per minute. Exceeding these limits triggers a spam_risk_too_many_posts error. These are TikTok-enforced rate limits. Publora's own plan quotas are separate and depend on your subscription tier.

Do I need to disclose commercial content on TikTok API posts?

Yes. If your video promotes a brand or involves a paid partnership, you must set commercialContent: true and specify either brandOrganic (your own brand) or brandedContent (paid partnership) in your platformSettings.tiktok object. Omitting this when required may violate TikTok's community guidelines and could result in content removal.

What is the caption character limit for TikTok API posts?

TikTok's API allows 2,200 characters for video captions (the native app allows 4,000). Hashtags are included in the character count — they are not separate. Publora passes through whatever caption you provide within this limit. For maximum engagement, keep captions concise and frontload the most important information.

Further Reading

Related Articles