Skip to content

TikTok

How to configure TikTok for OpenQuok — TikTok Developer portal, OAuth redirect URI, scopes, and backend env vars.

7 min read

Connect your agent today

Draft from chat, review in your calendar, and publish only what you approve.

Start for $0

Overview

TikTok publishing uses TikTok OAuth 2.0 (with PKCE).

You need a TikTok Developer, with Login Kit, Share Kit and Content Posting API, with backend env vars TIKTOK_CLIENT_ID and TIKTOK_CLIENT_SECRET.

TikTok servers fetch media from your storage via HTTPS URLs (“pull from URL” flow). That makes your public media base URL and TikTok domain verification critical for successful publish.

CLI walkthroughs: CLI Examples — TikTok.

Features

Supported

FeatureDetails
Video publishExactly one video attachment
Photo carousel publishOne or more images (no mixed video + images)
Caption lengthUp to 2,000 characters (TikTok provider limit)
PrivacyPUBLIC_TO_EVERYONE, MUTUAL_FOLLOW_FRIENDS, FOLLOWER_OF_CREATOR, SELF_ONLY (availability depends on account)
Posting methodDIRECT_POST (publish immediately) or UPLOAD (send to user inbox)
Duet / Stitch / Comments togglesOptional per post
Brand disclosure togglesOptional per post (brand/organic)
Platform analyticsAccount metrics (followers, following, likes, video count) plus aggregated recent-video engagement (views, likes, comments, shares) via user.info.stats and video.list
Per-post analyticsViews, likes, comments, and shares on a published video when the post row has a linked TikTok video id
Missing release id recoveryList recent TikTok videos and link inbox uploads (releaseId=missing) via posts:missingposts:connect — see CLI Examples — TikTok

Not supported

FeatureNotes
Mixed media (video + images)TikTok publish requires either a single video or an image carousel
Binary upload from OpenQuokOpenQuok publishes via public HTTPS URLs; it does not stream bytes directly to TikTok

Backend environment

OpenQuok reads TikTok credentials only through backend/config/GlobalConfig.ts. Set:

  • TIKTOK_CLIENT_ID — TikTok **Client key** from your TikTok app Credentials section
  • TIKTOK_CLIENT_SECRET — TikTok **Client secret**

Copy from backend/.env.development.example into backend/.env.development.local, fill values, then restart the backend.

The frontend base URL used for OAuth redirects comes from FRONTEND_DOMAIN_URL and must be HTTPS for TikTok in typical setups (local dev: https://localhost:5173).

OAuth redirect URI (register in TikTok)

TikTok redirects the browser back to your web app after consent—not to /api/v1. The backend builds the redirect from FRONTEND_DOMAIN_URL plus:

/integration/oauth/tiktok
  • Production: register
https://YOUR-FRONTEND-DOMAIN/integration/oauth/tiktok
  • Local development:
https://localhost:5173/integration/oauth/tiktok

Public media URLs

TikTok fetches media server-side via HTTPS URLs. Before you can publish reliably, ensure OpenQuok can resolve each attachment to a public URL and that TikTok accepts that domain.

Choose one media storage strategy:

  • Cloudflare R2 (recommended for production) — set STORAGE_PROVIDER=r2 and STORAGE_R2_PUBLIC_BASE_URL so objects have a stable public hostname.
  • Local disk (development or self-host) — set STORAGE_PROVIDER=local and ensure your deployment serves /uploads/* on your public HTTPS origin.

TikTok Developer app setup

Follow TikTok’s developer portal flow, then apply the OpenQuok-specific details below.

Create an app in TikTok Developer

Open TikTok Developer — My Apps and create a new app.

Create New Tiktok App

Create New Organization

Configure the App Details

In App Details → Basic Information:

Fill required app information (app name, category, description).

Configure Basic Info

Fill required urls (term of service, privacy policy, web urls).

For OpenQuok-hosted deployments, register your public Terms and Privacy Policy URLs (for example https://www.openquok.com/terms and https://www.openquok.com/privacy-policy). TikTok app review requires these links to be active and visible on your official website without opening a menu.

Configure App Urls

Enable Web + Login Kit + Add redirect URI

In Product → + Add products:

Add Product

Add the Login Kit product for OAuth.

Add Login Kit

For Product → Login Kit → Web, add the redirect URI from the OAuth redirect URI section to your app’s valid redirect list.

For production url, we can add as web url:

Add Web Redirect Url

Add Desktop Redirect Url

Enable Content Posting API (Direct Post)

In Product → + Add products:

Add Product

Add both Share Kit and Content Posting API

Add Share Kit

In Content Posting API, ensure Direct Post is allowed for your app.

Allow Direct Post

Add required scopes

In Scopes, configure the scopes your app needs. They include:

  • user.info.basic
  • user.info.profile
  • user.info.stats
  • video.publish
  • video.upload
  • video.list

Verify your media domain

Verify the hostname that serves your media (R2 public host or your app origin that serves /uploads/*) so TikTok can pull URLs during publish.

Add target users (Sandbox mode)

In Sandbox settingsTarget users, click Add account and sign in with each TikTok account that will connect a channel during development.

Troubleshooting

Unverified URL

Verify the media hostname in TikTok developer settings and ensure your public URLs are HTTPS.

Only Private Publish for Unverified APp

For unaudited developer apps, TikTok enforces two requirements on direct post (not inbox upload):

  1. Post privacy in OpenQuok: Only me (private) / SELF_ONLY.
  2. Account privacy in the TikTok app: set the connected profile to Private (TikTok → Settings and privacy → Privacy → Private account) at publish time.

Inbox upload (UPLOAD) sends media to the creator’s TikTok inbox and is not subject to the private-account rule. To publish directly to a public profile without these limits, submit your app for Content Posting API review in the TikTok developer portal.

Publish fails to fetch media

Confirm the attachment resolves to a public URL (no auth, no signed URLs that expire too quickly) and that the URL is reachable by TikTok’s servers.

References

Search documentation
Find a docs page
Discord Support