Platforms
TikTok
Upload and publish videos to TikTok via the PostPeer API.
Overview
Upload and publish videos to TikTok programmatically. PostPeer handles TikTok's multi-step upload process, content policies, and OAuth.
Quick Start
1. Connect a TikTok Account
curl https://api.postpeer.dev/v1/connect/tiktok \
-H "x-access-key: YOUR_API_KEY"Returns a TikTok OAuth URL. The user authorizes video upload permissions. See Connect Accounts for the full OAuth flow.
2. Publish a Video
curl -X POST "https://api.postpeer.dev/v1/posts" \
-H "x-access-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Quick tutorial! #coding #devtips",
"platforms": [
{ "platform": "tiktok", "accountId": "tt_321" }
],
"mediaItems": [
{ "type": "video", "url": "https://cdn.example.com/video.mp4" }
],
"publishNow": true
}'Response:
{
"success": true,
"status": "published",
"postId": "post_pqr678",
"platforms": [
{
"platform": "tiktok",
"success": true,
"platformPostUrl": "https://www.tiktok.com/@user/video/7123456789"
}
]
}Platform-Specific Data
| Field | Type | Description |
|---|---|---|
privacyLevel | string | "public", "friends", or "private" |
commentDisabled | boolean | Disable comments on the video |
duetDisabled | boolean | Disable duets |
stitchDisabled | boolean | Disable stitches |
Media Requirements
| Type | Formats | Aspect Ratio | Duration |
|---|---|---|---|
| Video | MP4, WebM | 9:16 (vertical) | 1s - 10 min |
Cross-Post
Upload one vertical video to TikTok, YouTube Shorts, and Instagram Reels in a single request:
curl -X POST "https://api.postpeer.dev/v1/posts" \
-H "x-access-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "New tutorial out now!",
"platforms": [
{ "platform": "tiktok", "accountId": "tt_321" },
{ "platform": "youtube", "accountId": "yt_789", "platformSpecificData": { "title": "New Tutorial", "privacyStatus": "public" } },
{ "platform": "instagram", "accountId": "ig_456" }
],
"mediaItems": [
{ "type": "video", "url": "https://cdn.example.com/vertical.mp4" }
],
"publishNow": true
}'