Skip to main content

TikTok

SimplePost uses TikTok's Content Posting API for videos and photos. TikTok app review status affects whether you can publish publicly or only upload drafts/private posts.

Content support

CapabilitySupport
VideosOne video per post. MP4 recommended. Max file size 4 GB.
PhotosOne photo per post. JPEG or PNG. Max file size 50 MB.
Caption2200 characters for video posts, 90 characters for photo posts.
Required mediaYes.
Publish modespublic (direct publish) or draft (upload to TikTok inbox for the user to publish manually).
Visibilitypublic, friends, or private when direct publishing.
InteractionsComment, duet, and stitch controls.

Unaudited TikTok apps may require the TikTok account to be private and may restrict public publishing. Use visibility: "private" while testing if your app is not reviewed.

Set up credentials

  1. Create a TikTok developer app.
  2. Enable Content Posting products.
  3. Configure redirect URIs for your app or Scheduler deployment.
  4. Request posting scopes.
  5. Authorize the creator account.
  6. Store the access token returned by TikTok.
  7. Confirm that the app tier and account privacy settings allow the publishing mode you plan to use.

The CLI does not bundle a TikTok OAuth app. To use it from the CLI, supply your own client key through the OAuth prompt and the client secret through SIMPLE_POST_TIKTOK_CLIENT_SECRET before running simplepost account add tiktok.

Environment variables

TIKTOK_ACCESS_TOKEN=

SDK options

await post({
content: {
text: "Check out this video",
media: [
{
type: "video",
path: "./video.mp4",
title: "My TikTok Video",
},
],
},
platforms: ["tiktok"],
options: {
tiktok: {
publishMode: "draft",
visibility: "private",
allowComment: true,
allowDuet: true,
allowStitch: true,
},
},
});
OptionValuesDescription
publishModedraft, publicUpload to inbox or publish immediately.
visibilitypublic, friends, privateWho can view direct posts.
allowCommentbooleanAllow comments.
allowDuetbooleanAllow duets.
allowStitchbooleanAllow stitches.

REST server account

Add this entry under accounts in the self-hosted REST server's accounts.json:

{
"id": "tiktok-creator",
"platform": "tiktok",
"username": "yourbrand",
"credentials": { "accessToken": "..." },
"options": {
"publishMode": "public",
"visibility": "public"
}
}