Skip to Content
ChannelsTiktokTikTok — Channel Overview

TikTok — Channel Overview

Researched: May 2026

Contents

  • README.md — This file: overview, what to build, implementation plan

Full deferred-feature notes live at docs/missing-incomplete-features/tiktok-publishing.md and docs/missing-incomplete-features/twitter-x-tiktok-channels.md.


Status

Deactivated — removed from the active channel catalogue April 2026. The SocialPost model already has a TikTok platform enum value and the Social Post Writer/Designer handle TikTok output format. What’s missing is the OAuth provider and the publisher worker.


Why This Channel

TikTok is the dominant short-form video platform with over 1 billion monthly active users. For Leadmetrics clients in consumer verticals — food, beauty, fitness, retail, local services — TikTok is often where their audience actually lives. Competitors like Later and Hootsuite publish to TikTok. Clients in these verticals specifically ask for it.

The core challenge: TikTok’s Content Posting API requires video — there is no text-only or image-only post API. Every post must include a video asset. This makes TikTok fundamentally different from Instagram/Facebook and requires either a video generation pipeline or a manual-publish fallback.


Auth Mechanism

OAuth 2.0 (standard authorization code flow, not PKCE).

  • Auth URL: https://www.tiktok.com/v2/auth/authorize
  • Token URL: https://open.tiktokapis.com/v2/oauth/token/
  • Scopes: user.info.basic video.upload video.publish
  • Token refresh: access token expires in 24 hours; refresh token in 365 days

The provider stores accessToken, refreshToken, accessTokenExpiresAt, and openId (TikTok’s user identifier).


What It Enables

CapabilityDetail
PublishingVideo posts up to 60s (Phase 2: up to 10 min); caption up to 2200 chars; hashtags
Manual publish assistPhase 1: generate caption + copy to clipboard + deep link to TikTok Creator
AnalyticsViews, likes, comments, shares, reach per video (via TikTok Display API)
Insight workerTop video themes; optimal post time; hashtag performance; content-type breakdown

Workers Needed

WorkerQueueTrigger
tiktok-publisher.worker.ts (new, Phase 2)agent__tiktok-publisherSocialPost status → scheduled or client_approved
tiktok-insights.worker.ts (new)agent__tiktok-insightsWeekly

Phase 1 has no publisher worker — the DM publishes manually using the generated caption + assets.


Two-Phase Video Upload (Phase 2)

TikTok’s Content Posting API requires a chunked upload:

1. POST /v2/post/publish/video/init/ → returns { publish_id, upload_url } 2. PUT <upload_url> with video chunks → chunked transfer (each chunk ≤ 64 MB) 3. POST /v2/post/publish/video/ → with { publish_id, caption, privacy_level, ... } → returns { publish_id } for polling 4. GET /v2/post/publish/status/fetch/ → poll until PUBLISH_COMPLETE or FAILED

The video file must exist in DigitalOcean Spaces before the worker runs. The Social Post Designer must produce a video export (MP4) as a required output for TikTok posts.


Insight Worker Output (ChannelInsight)

  • Average views per video over 30 days
  • Top 5 hashtags by engagement
  • Best posting days / hours
  • Video completion rate trend
  • Suggested: next video concept based on top-performing content

Implementation Plan

Phase 1 — Connect + Manual Publish

  1. Create packages/providers/tiktok/src/index.ts:

    • getAuthUrl(callbackUrl, channelId) — auth URL + state
    • exchangeCode(code, callbackUrl) — returns tokens + openId
    • refreshAccessToken(refreshToken) — returns new access token
    • getUserInfo(accessToken, openId) — display name, avatar
    • verify() — connection health check
  2. Add OAuth routes to apps/api/src/routers/channel-connect.ts:

    • GET /tiktok/connect → return auth URL
    • GET /tiktok/callback → exchange code, store tokens, close popup
  3. Re-activate seed entry in packages/db/prisma/seed.ts

  4. Social Post pipeline: for TikTok posts, set publishMethod: "manual" on SocialPost. DM Portal shows “Copy Caption” + “Download Assets” + “Open TikTok Creator” link instead of scheduling controls.

  5. Create apps/dashboard/src/app/(dashboard)/channels/[id]/TikTokChannelDetail.tsx

Phase 2 — API Publish

  1. Add chunked video upload methods to the provider package

  2. Create packages/agents/src/workers/tiktok-publisher.worker.ts

    • Pull video MP4 from DigitalOcean Spaces
    • initVideoUpload → chunk upload → createVideoPost → poll status
    • Update SocialPost with tiktokPostId + share URL on success
  3. Add Insights tab + tiktok-insights.worker.ts


Open Decisions

DecisionCurrent thinking
Phase 1 manual vs Phase 2 APIShip Phase 1 first; unblock clients who can post manually
Video generationSocial Post Designer must produce MP4; no video = TikTok post stays in manual_pending
SchedulingPhase 2: TikTok API supports scheduled posts natively; use that rather than Leadmetrics scheduler

Seed Entry

// packages/db/prisma/seed.ts — CHANNEL_CATALOGUE { type: "TikTok", name: "TikTok", iconKey: "tiktok", description: "Publish short-form video content to TikTok.", authenticationType: "oauth2", requiresUrl: false, isActive: true, // change from false categories: ["social_media"], },

  • docs/missing-incomplete-features/tiktok-publishing.md
  • docs/missing-incomplete-features/twitter-x-tiktok-channels.md
  • packages/agents/src/workers/social-publisher.worker.ts
  • packages/agents/src/workers/social-post-designer.worker.ts

© 2026 Leadmetrics — Internal use only