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.

Status: Coming soon. TikTok integration is currently in development.

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.

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

FieldTypeDescription
privacyLevelstring"public", "friends", or "private"
commentDisabledbooleanDisable comments on the video
duetDisabledbooleanDisable duets
stitchDisabledbooleanDisable stitches

Media Requirements

TypeFormatsAspect RatioDuration
VideoMP4, WebM9: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
  }'

On this page