TikTok API Guide

How to Schedule TikTok Videos via API

Upload and schedule TikTok videos programmatically using the PostFast API. Control privacy, engagement settings, duets, stitches, and branded content.

Last updated: January 2025
Automate your TikTok video strategyGet API Key

TikTok is the leading short-form video platform with over 1 billion monthly active users. Using the PostFast API, you can schedule TikTok videos with full control over privacy settings, engagement features (comments, duets, stitches), and branded content disclosure.

The API supports fully automated posting - no manual intervention required. Upload your video, set your preferred controls, and PostFast handles the rest. Videos are published at your scheduled time with all settings applied.

Key capabilities when scheduling TikTok videos via API include privacy control (public, mutual friends, private), engagement toggles (comments, duets, stitches), branded content disclosure, automatic music addition, and custom cover timestamps for thumbnails.

API Parameters

ParameterTypeDescription
tiktokPrivacystringControls who can view the video
PUBLICMUTUAL_FRIENDSONLY_ME
tiktokAllowCommentsbooleanAllow comments on the video
tiktokAllowDuetbooleanAllow other users to create duets with this video
tiktokAllowStitchbooleanAllow other users to stitch this video
tiktokBrandOrganicbooleanMark as brand organic content (self-promotional)
tiktokBrandContentbooleanMark as branded content (sponsored/partnership)
tiktokAutoAddMusicbooleanAutomatically add background music to the video

Code Example

const response = await fetch('https://api.postfa.st/social-posts', {
  method: 'POST',
  headers: {
    'pf-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
        "posts": [
            {
                "content": "3 productivity hacks that changed my morning routine ☀️ Which one are you trying first? #productivity #morningroutine #lifehacks",
                "mediaItems": [
                    {
                        "key": "video/a7b8c9d1-e2f3-4567-8901-23456789abcd.mp4",
                        "type": "VIDEO",
                        "sortOrder": 0,
                        "coverTimestamp": "3"
                    }
                ],
                "scheduledAt": "2025-01-31T10:00:00.000Z",
                "socialMediaId": "550e8400-e29b-41d4-a716-446655440001"
            }
        ],
        "controls": {
            "tiktokPrivacy": "PUBLIC",
            "tiktokAllowComments": true,
            "tiktokAllowDuet": true,
            "tiktokAllowStitch": true
        }
    })
});

const data = await response.json();

Did You Know?

Video Size
Max 250 MB
PostFast platform limit. Compress videos before upload if needed
Video Duration
3 seconds - 10 minutes
Videos 15-30 seconds perform best for engagement
Aspect Ratio
9:16 (1080×1920)
Vertical video recommended. Square 1:1 and landscape 16:9 also supported
Video Format
MP4, MOV
H.264 video codec with AAC audio recommended
Cover Timestamp
In seconds
Use coverTimestamp to set thumbnail frame (e.g., "3" for 3 seconds)
Caption Length
2,200 characters
Same as TikTok native app limit

Tips

Use coverTimestamp to set the perfect thumbnail - e.g., "3" for 3 seconds into the video

Videos 15-30 seconds perform best for TikTok's algorithm and engagement

Enable Duet and Stitch to encourage community engagement and boost reach

Mark branded content appropriately (tiktokBrandContent) for FTC/TikTok compliance

Export at 1080p - TikTok downscales 4K videos anyway

Add captions to your video - 73% of TikTok users watch without sound

Hook viewers in the first 3 seconds to reduce scroll-away

Schedule videos, carousels, and drafts to TikTok via API

7-day free trial
Try PostFast Free

Common Pitfalls

Missing coverTimestamp

Without coverTimestamp, TikTok picks a random frame as the thumbnail. Set it explicitly for a professional look.

Horizontal video orientation

Landscape (16:9) videos get letterboxed on TikTok. Use vertical 9:16 format for full-screen display.

Unmarked branded content

Failing to set tiktokBrandContent: true on sponsored posts violates TikTok policy and can result in account penalties.

File too large

Files over 250 MB will be rejected. Compress your video before upload using H.264 codec at 6-8 Mbps bitrate.

Wrong video format

Use MP4 or MOV with H.264 codec. Other formats like WebM or AVI may fail or have quality issues.

Confusing draft with privacy

tiktokIsDraft: true saves as draft (not published). tiktokPrivacy: "ONLY_ME" publishes but makes it private. They are different!

Frequently Asked Questions

What video formats work with the TikTok API?

MP4 and MOV formats with H.264 video codec and AAC audio codec work best. Keep videos under 250 MB and use 6-8 Mbps bitrate for optimal quality.

How do I set the video thumbnail?

Use the coverTimestamp field in your mediaItem object. Set it to the number of seconds into the video where you want the thumbnail captured (e.g., "3" for 3 seconds).

What's the difference between brand organic and brand content?

tiktokBrandOrganic is for self-promotional content about your own brand. tiktokBrandContent is for sponsored/partnership content where you're paid to promote another brand. Use the appropriate flag for FTC compliance.

Build your TikTok presence with programmatic video posting

Start Free Trial
7-day free trialCancel anytime