Skip to content

TikTok

CLI examples for TikTok publishing in OpenQuok

2 min read

Connect your agent today

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

Start for $0

Channel quick reference

PropertyValue
Provider identifiertiktok
Max caption length2,000 characters (-c body)
Required attachmentsEither one video or one+ images (no mixing)
OAuth setupTikTok
TIKTOK_ID=$(openquok integrations:list | jq -r '.[] | select(.identifier=="tiktok") | .id')

Video with privacy + DIRECT_POST

test -f ./clip.mp4 && test -s ./clip.mp4
VIDEO=$(openquok upload ./clip.mp4 | jq -c '[{id: .data.id, path: (.data.path // .data.filePath)}]')

openquok posts:create 
  -c "Vertical clip — scheduled from the CLI." 
  -m "$VIDEO" 
  -s "2026-01-01T12:00:00Z" 
  -i "$TIKTOK_ID" 
  --providerSettingsByIntegrationId "$(jq -nc --arg id "$TIKTOK_ID" '
    {
      ($id): {
        privacy_level: "PUBLIC_TO_EVERYONE",
        content_posting_method: "DIRECT_POST",
        comment: true,
        duet: false,
        stitch: false
      }
    }
  ')"

TikTok photo posts support a separate short title field (often capped around 90 characters). Upload one or more images and pass them as media:

MEDIA=$(jq -s 'add' 
  <(openquok upload ./a.jpg | jq '[{id: .data.id, path: (.data.path // .data.filePath)}]') 
  <(openquok upload ./b.jpg | jq '[{id: .data.id, path: (.data.path // .data.filePath)}]'))

openquok posts:create 
  -c "Carousel caption — links in bio." 
  -m "$MEDIA" 
  -s "2026-01-01T12:00:00Z" 
  -i "$TIKTOK_ID" 
  --providerSettingsByIntegrationId "$(jq -nc --arg id "$TIKTOK_ID" '
    {
      ($id): {
        title: "A short photo title",
        privacy_level: "PUBLIC_TO_EVERYONE",
        content_posting_method: "DIRECT_POST"
      }
    }
  ')"

UPLOAD (send to user inbox)

When you set content_posting_method=UPLOAD, TikTok can return a status that indicates the post was sent to the user inbox for final action.

openquok posts:create 
  -c "Send to inbox instead of direct publish." 
  -m "$VIDEO" 
  -s "2026-01-01T12:00:00Z" 
  -i "$TIKTOK_ID" 
  --providerSettingsByIntegrationId "$(jq -nc --arg id "$TIKTOK_ID" '
    { ($id): { privacy_level: "PUBLIC_TO_EVERYONE", content_posting_method: "UPLOAD" } }
  ')"

Platform analytics

openquok analytics:platform "$TIKTOK_ID" -d 30

Post insights

POST_ID=$(openquok posts:list | jq -r '.items[] | select(.identifier=="tiktok") | .id' | head -1)
openquok analytics:post "$POST_ID" -d 7

Returns views, likes, comments, and shares when the post row has a linked TikTok video id. Inbox uploads store releaseId=missing until you connect the live id — see Connecting missing posts.

Missing release id (inbox uploads)

POST_ID=$(openquok posts:list | jq -r '.items[] | select(.identifier=="tiktok" and .releaseId=="missing") | .id' | head -1)
openquok posts:missing "$POST_ID" | jq '.data.items[] | {id, url}'
openquok posts:connect "$POST_ID" -r "<tiktok-video-id>"
Search documentation
Find a docs page
Discord Support