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.mdanddocs/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
| Capability | Detail |
|---|---|
| Publishing | Video posts up to 60s (Phase 2: up to 10 min); caption up to 2200 chars; hashtags |
| Manual publish assist | Phase 1: generate caption + copy to clipboard + deep link to TikTok Creator |
| Analytics | Views, likes, comments, shares, reach per video (via TikTok Display API) |
| Insight worker | Top video themes; optimal post time; hashtag performance; content-type breakdown |
Workers Needed
| Worker | Queue | Trigger |
|---|---|---|
tiktok-publisher.worker.ts (new, Phase 2) | agent__tiktok-publisher | SocialPost status → scheduled or client_approved |
tiktok-insights.worker.ts (new) | agent__tiktok-insights | Weekly |
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 FAILEDThe 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
-
Create
packages/providers/tiktok/src/index.ts:getAuthUrl(callbackUrl, channelId)— auth URL + stateexchangeCode(code, callbackUrl)— returns tokens +openIdrefreshAccessToken(refreshToken)— returns new access tokengetUserInfo(accessToken, openId)— display name, avatarverify()— connection health check
-
Add OAuth routes to
apps/api/src/routers/channel-connect.ts:GET /tiktok/connect→ return auth URLGET /tiktok/callback→ exchange code, store tokens, close popup
-
Re-activate seed entry in
packages/db/prisma/seed.ts -
Social Post pipeline: for TikTok posts, set
publishMethod: "manual"onSocialPost. DM Portal shows “Copy Caption” + “Download Assets” + “Open TikTok Creator” link instead of scheduling controls. -
Create
apps/dashboard/src/app/(dashboard)/channels/[id]/TikTokChannelDetail.tsx
Phase 2 — API Publish
-
Add chunked video upload methods to the provider package
-
Create
packages/agents/src/workers/tiktok-publisher.worker.ts- Pull video MP4 from DigitalOcean Spaces
initVideoUpload→ chunk upload →createVideoPost→ poll status- Update
SocialPostwithtiktokPostId+ share URL on success
-
Add Insights tab +
tiktok-insights.worker.ts
Open Decisions
| Decision | Current thinking |
|---|---|
| Phase 1 manual vs Phase 2 API | Ship Phase 1 first; unblock clients who can post manually |
| Video generation | Social Post Designer must produce MP4; no video = TikTok post stays in manual_pending |
| Scheduling | Phase 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"],
},Related
docs/missing-incomplete-features/tiktok-publishing.mddocs/missing-incomplete-features/twitter-x-tiktok-channels.mdpackages/agents/src/workers/social-publisher.worker.tspackages/agents/src/workers/social-post-designer.worker.ts