# How to Automate TikTok Video Posting using the API

- Tool: API Automations
- Difficulty: Advanced
- Fix time: 1-2 hours
- Compatibility: TikTok Developer account required; video.publish scope; without audit approval posts are private (SELF_ONLY); daily cap ~15 posts per creator account; access token expires every 24 hours
- Last updated: May 2026

## TL;DR

Automate TikTok video posting using the Content Posting API's Direct Post flow: query creator settings with POST /v2/post/publish/creator_info/query/, initialize the upload with POST /v2/post/publish/video/init/, upload video chunks via PUT to the provided upload URL, then poll status with POST /v2/post/publish/status/fetch/. Access tokens expire every 24 hours. Without TikTok audit approval (2-6 weeks), all posts go to SELF_ONLY (private). Daily cap is ~15 posts per creator account.

## Best practices

- Always call creator_info/query before every post and display creator_nickname in your UI — this is a hard TikTok audit requirement
- Apply for the Content Posting Audit early in development (it takes 2-6 weeks) — test with SELF_ONLY during the wait
- Always refresh the access token at the start of every posting flow — the 24-hour expiry is strict
- Use exactly 10MB chunk size for reliable uploads — smaller increases HTTP overhead, larger risks timeouts
- Start uploading immediately after receiving the upload_url from video/init/ — the URL has a time limit
- Track the daily posting cap (~15/account) in your own database and build queue management to distribute posts across days
- Store publish_id and the resulting video_id for every post — this is your audit trail and debugging data

## Frequently asked questions

### Why are my TikTok posts private (SELF_ONLY) even when I set PUBLIC_TO_EVERYONE?

Your app has not passed TikTok's Content Posting Audit. Without audit approval, all posts are forced to SELF_ONLY mode regardless of the privacy_level parameter you set. The audit takes 2-6 weeks and requires demonstrating that your app serves a broad audience. Apply at developers.tiktok.com under Content Posting API. During development, test with SELF_ONLY intentionally to validate your flow works before the audit completes.

### What happens when my TikTok access token expires?

You'll get error code 'access_token_invalid' (HTTP 401) on all API calls. TikTok access tokens expire every 24 hours without exception. You must call POST /v2/oauth/token/ with grant_type=refresh_token and your 365-day refresh_token to get a new access_token. Set up an automated cron job that runs every 18-20 hours to refresh before expiry. Alert if the refresh fails — a failed refresh means your next post attempt will also fail.

### How does TikTok's chunked video upload work?

After calling /video/init/, you receive an upload_url. Split your video into chunks (10MB recommended) and PUT each one with a Content-Range header in the format 'bytes {start}-{end}/{total}'. For example, for a 30MB video: first chunk is 'bytes 0-10485759/31457280', second is 'bytes 10485760-20971519/31457280', third is 'bytes 20971520-31457279/31457280'. Upload chunks sequentially — TikTok does not support parallel chunk uploads. Start uploading immediately after receiving the upload_url as it has a time limit.

### What is the daily posting limit for TikTok's API?

TikTok's official documentation states: 'The upper limit may vary among creators (typically around 15 posts per day per creator account) and is shared across all API Clients using Direct Post.' This is not a hard published number — it depends on the creator account's settings agreed upon during your audit application. The limit is shared across all apps using the Direct Post API for that creator, not per-app.

### What video formats does the TikTok API accept?

Supported formats: MP4, MOV, WEBM, AVI. Recommended: MP4 with H.264 video codec and AAC audio codec, 9:16 aspect ratio, 1080x1920px, 23-60 FPS. File size up to 1GB via API. Minimum duration: 3 seconds. Maximum duration: varies per creator (from creator_info/query). Re-encode with ffmpeg if needed: `ffmpeg -i input.mp4 -c:v libx264 -c:a aac -vf scale=1080:1920 output.mp4`.

### Can RapidDev help navigate the TikTok audit process?

Yes — RapidDev has experience with the TikTok Content Posting Audit process and building compliant applications. We help structure your app's use case to pass the audit, build the required UX elements (creator nickname display, commercial content checkbox), and implement the full posting pipeline. Book a free consultation at rapidevelopers.com.

### What are the mandatory UX requirements for TikTok's audit?

TikTok's audit requires: (1) display the creator's nickname from creator_info/query in your posting UI, (2) include a Commercial Content checkbox with two options — 'Your Brand' and 'Branded Content (Paid Partnership)' — for posts containing branded content, and (3) let users consent to music usage for their post. Skipping these UI elements is grounds for audit rejection. The audit reviewer will test your app's actual interface.

---

Source: https://www.rapidevelopers.com/api-automations/how-to-automate-tiktok-video-posting-using-the-api
© RapidDev — https://www.rapidevelopers.com/api-automations/how-to-automate-tiktok-video-posting-using-the-api
