TikTok API Documentation

🚀 Social Viber TikTok API Wrapper

Use our simplified API to post photos and videos to TikTok without dealing with complex OAuth flows or token management.

Getting Started

1. Connect Your TikTok Account

  1. Create an account on Social Viber
  2. Go to your Dashboard → Accounts and click "Connect TikTok Account"
  3. Authorize your TikTok account through our secure OAuth flow
  4. Copy your unique API key from the accounts page

2. Start Publishing

Use your API key to publish content directly. The account is automatically detected from your API key:

Authorization: Bearer your-api-key

API Endpoints

POST /api/tiktok/direct-post

Post photos or videos directly to TikTok with automatic media processing. The account is automatically detected from your API key.

Request Headers

Authorization: Bearer your-api-key
Content-Type: application/json

Photo Post Example

{
  "media_type": "PHOTO",
  "photo_images": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.jpg"
  ],
  "photo_cover_index": 0,
  "post_info": {
    "title": "Check out these amazing photos! #photography",
    "privacy_level": "SELF_ONLY",
    "disable_comment": false,
    "auto_add_music": false
  }
}

Video Post Example

{
  "media_type": "VIDEO",
  "video_url": "https://example.com/video.mp4",
  "post_info": {
    "title": "My awesome video! #viral #trending",
    "privacy_level": "SELF_ONLY",
    "disable_comment": false,
    "disable_duet": false,
    "disable_stitch": false
  }
}

Success Response

{
  "success": true
}

Error Response

{
  "success": false,
  "error": "Error message describing what went wrong"
}

Simplified API: The account is automatically detected from your API key, and all media URLs are processed automatically. No need to specify account_id, source, or post_mode fields.

GET /api/tiktok/status/{publishId}

Note: This endpoint is currently not returning publish_id from POST requests. Status checking may be added in future updates.

Media Requirements

📸 Photo Requirements

  • • Max 35 photos per post
  • • Max 20MB per photo
  • • 1080p resolution max
  • • Formats: JPEG, WebP

🎥 Video Requirements

  • • Max 4GB file size
  • • Max 3 minutes duration
  • • 360p - 4096p resolution
  • • 23-60 FPS
  • • Formats: MP4, WebM, MOV

Automatic Features

🔄 Smart Media Processing

  • Auto URL Processing: Provide any image/video URL and we'll download and upload it to our secure storage
  • Format Optimization: Automatic conversion to TikTok-compatible formats
  • Error Handling: Comprehensive validation and user-friendly error messages
  • Status Tracking: Real-time post status monitoring
  • Usage Analytics: Track your API usage and post statistics

Current Limitations

⚠️ Unaudited Client Restrictions

As our TikTok app is currently in sandbox mode (unaudited), the following restrictions apply:

  • Privacy: Posts are limited to "SELF_ONLY" (private posts only)
  • Account Requirement: Your TikTok account must be set to private
  • Daily Limits: ~15 posts per user per day
  • User Limit: Maximum 5 users per 24-hour period

These limitations will be removed once our app completes TikTok's audit process.

Error Codes

ErrorDescription
401Invalid or missing API key
400Invalid request format or missing required fields
429Daily usage limit exceeded
413File size exceeds limits

Code Examples

JavaScript/Node.js

const response = await fetch('https://yourapp.com/api/tiktok/direct-post', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer your-api-key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    media_type: 'PHOTO',
    photo_images: ['https://example.com/image.jpg'],
    post_info: {
      title: 'My awesome post! #photography',
      privacy_level: 'SELF_ONLY',
      disable_comment: false
    }
  })
});

const result = await response.json()

Python

import requests

response = requests.post(
    'https://yourapp.com/api/tiktok/direct-post',
    headers={
        'Authorization': 'Bearer your-api-key',
        'Content-Type': 'application/json'
    },
    json={
        'media_type': 'VIDEO',
        'video_url': 'https://example.com/video.mp4',
        'post_info': {
            'title': 'My viral video! #trending',
            'privacy_level': 'SELF_ONLY',
            'disable_comment': False,
            'disable_duet': False
        }
    }
)

result = response.json()
print(result)

cURL

curl -X POST https://yourapp.com/api/tiktok/direct-post \
  -H "Authorization: Bearer your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "media_type": "PHOTO",
    "photo_images": ["https://example.com/image.jpg"],
    "post_info": {
      "title": "Posted via Social Viber API!",
      "privacy_level": "SELF_ONLY",
      "disable_comment": false
    }
  }'

Support

Need help? Check out our Dashboard for API usage analytics and account management, or contact our support team.

🎯 Quick Start Summary

  1. 1. Sign up and connect your TikTok account
  2. 2. Get your API key from the dashboard
  3. 3. Make API calls with your media URLs
  4. 4. We handle all the complex TikTok integration for you!