Skip to content

Publishing Videos to TikTok ​

Endpoint POST /api/tiktok/upload publishes video content directly to connected TikTok accounts.


1. Specifications & Cost ​

  • Endpoint: POST /api/tiktok/upload
  • Credit Cost: 5 Credits per successful publish.
  • Format: application/json (Pure JSON).

Prerequisite: Connecting Your TikTok Channel Before Uploading

To publish videos via API, your workspace must have at least one active connected channel. You can link your TikTok account automatically in seconds using the open-source extension StackVid Connect or manually via Channel Management.


2. Payload Parameters ​

ParameterTypeRequiredDescription
videoUrlStringYesDirect video download URL (CDN/S3/cloud URL or from Presigned Upload endpoint)
captionStringNoPost caption, hashtags, and mentions
targetChannelStringNoTarget channel name or handle (defaults to isDefault)
coverUrlStringNoCustom thumbnail URL
privacyLevelNumberNo0 = Public (default), 1 = Friends, 2 = Private
allowCommentBooleanNoAllow user comments (default: true)
allowDuetBooleanNoAllow Duet creation (default: true)
allowStitchBooleanNoAllow Stitch creation (default: true)
soundIdStringNoOfficial TikTok sound ID to attach
productAnchorsArrayNoTikTok Shop showcase products to link

3. Code Example ​

bash
curl -X POST https://api.stackvid.dev/api/tiktok/upload \
  -H "X-API-Key: tk_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "videoUrl": "https://media.yourdomain.com/stackvid-uploads/video.mp4",
    "caption": "New outfit review! #fashion #outfit",
    "targetChannel": "US Fashion Channel",
    "privacyLevel": 0,
    "allowComment": true
  }'
typescript
import axios from 'axios';

const res = await axios.post(
  'https://api.stackvid.dev/api/tiktok/upload',
  {
    videoUrl: 'https://media.yourdomain.com/stackvid-uploads/video.mp4',
    caption: 'New outfit review! #fashion #outfit',
    targetChannel: 'US Fashion Channel',
    privacyLevel: 0,
  },
  { headers: { 'X-API-Key': 'tk_live_YOUR_API_KEY' } }
);

console.log('Published:', res.data.shareUrl);

4. Successful Response ​

json
{
  "success": true,
  "itemId": "7419827391823719283",
  "shareUrl": "https://www.tiktok.com/@fashion_us/video/7419827391823719283",
  "status": "PUBLISHED",
  "creditDeducted": 5,
  "remainingBalance": 45
}

StackVid - Multi-Platform Video & Social Commerce Automation Platform.