KosmoKrator

marketing

TikTok CLI for AI Agents

Use the TikTok CLI from KosmoKrator to call TikTok tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write Bearer token auth

TikTok CLI Setup

TikTok can be configured headlessly with `kosmokrator integrations:configure tiktok`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure tiktok --set access_token="$TIKTOK_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor tiktok --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token TIKTOK_ACCESS_TOKEN Secret secret yes Access Token
base_url TIKTOK_BASE_URL URL url no API Base URL

Call TikTok Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call tiktok.tiktok_list_videos '{
  "advertiser_id": "example_advertiser_id",
  "page": 1,
  "page_size": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:tiktok tiktok_list_videos '{
  "advertiser_id": "example_advertiser_id",
  "page": 1,
  "page_size": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs tiktok --json
kosmo integrations:docs tiktok.tiktok_list_videos --json
kosmo integrations:schema tiktok.tiktok_list_videos --json
kosmo integrations:search "TikTok" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to TikTok.

tiktok.tiktok_list_videos

Read read

List videos available for an advertiser in TikTok Business. Returns video IDs, names, and metadata.

Parameters
advertiser_id, page, page_size

Generic CLI call

kosmo integrations:call tiktok.tiktok_list_videos '{"advertiser_id":"example_advertiser_id","page":1,"page_size":1}' --json

Provider shortcut

kosmo integrations:tiktok tiktok_list_videos '{"advertiser_id":"example_advertiser_id","page":1,"page_size":1}' --json

tiktok.tiktok_get_video

Read read

Get details for a specific TikTok video, including preview URL, duration, and status.

Parameters
advertiser_id, video_id

Generic CLI call

kosmo integrations:call tiktok.tiktok_get_video '{"advertiser_id":"example_advertiser_id","video_id":"example_video_id"}' --json

Provider shortcut

kosmo integrations:tiktok tiktok_get_video '{"advertiser_id":"example_advertiser_id","video_id":"example_video_id"}' --json

tiktok.tiktok_upload_video

Write write

Upload a video to TikTok via URL for use in advertising campaigns.

Parameters
advertiser_id, video_url, file_name

Generic CLI call

kosmo integrations:call tiktok.tiktok_upload_video '{"advertiser_id":"example_advertiser_id","video_url":"example_video_url","file_name":"example_file_name"}' --json

Provider shortcut

kosmo integrations:tiktok tiktok_upload_video '{"advertiser_id":"example_advertiser_id","video_url":"example_video_url","file_name":"example_file_name"}' --json

tiktok.tiktok_list_campaigns

Read read

List advertising campaigns for a TikTok advertiser. Returns campaign IDs, names, status, and budgets.

Parameters
advertiser_id, page, page_size

Generic CLI call

kosmo integrations:call tiktok.tiktok_list_campaigns '{"advertiser_id":"example_advertiser_id","page":1,"page_size":1}' --json

Provider shortcut

kosmo integrations:tiktok tiktok_list_campaigns '{"advertiser_id":"example_advertiser_id","page":1,"page_size":1}' --json

tiktok.tiktok_get_campaign

Read read

Get details for a specific TikTok advertising campaign, including budget, schedule, and performance.

Parameters
advertiser_id, campaign_id

Generic CLI call

kosmo integrations:call tiktok.tiktok_get_campaign '{"advertiser_id":"example_advertiser_id","campaign_id":"example_campaign_id"}' --json

Provider shortcut

kosmo integrations:tiktok tiktok_get_campaign '{"advertiser_id":"example_advertiser_id","campaign_id":"example_campaign_id"}' --json

tiktok.tiktok_list_advertisers

Read read

List advertisers accessible to the authenticated TikTok Business user. Returns advertiser IDs, names, and company details.

Parameters
app_id, secret

Generic CLI call

kosmo integrations:call tiktok.tiktok_list_advertisers '{"app_id":"example_app_id","secret":"example_secret"}' --json

Provider shortcut

kosmo integrations:tiktok tiktok_list_advertisers '{"app_id":"example_app_id","secret":"example_secret"}' --json

tiktok.tiktok_get_current_user

Read read

Get the authenticated user's TikTok Business account information, including display name, email, and status.

Parameters
none

Generic CLI call

kosmo integrations:call tiktok.tiktok_get_current_user '{}' --json

Provider shortcut

kosmo integrations:tiktok tiktok_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

tiktok.tiktok_list_videos

List videos available for an advertiser in TikTok Business. Returns video IDs, names, and metadata.

Operation
Read read
Schema command
kosmo integrations:schema tiktok.tiktok_list_videos --json
ParameterTypeRequiredDescription
advertiser_id string yes The TikTok advertiser ID.
page integer no Page number for pagination. Defaults to 1.
page_size integer no Number of videos per page. Defaults to 10.

tiktok.tiktok_get_video

Get details for a specific TikTok video, including preview URL, duration, and status.

Operation
Read read
Schema command
kosmo integrations:schema tiktok.tiktok_get_video --json
ParameterTypeRequiredDescription
advertiser_id string yes The TikTok advertiser ID.
video_id string yes The TikTok video ID.

tiktok.tiktok_upload_video

Upload a video to TikTok via URL for use in advertising campaigns.

Operation
Write write
Schema command
kosmo integrations:schema tiktok.tiktok_upload_video --json
ParameterTypeRequiredDescription
advertiser_id string yes The TikTok advertiser ID.
video_url string yes The URL of the video to upload (must be publicly accessible).
file_name string no A custom name for the uploaded video file.

tiktok.tiktok_list_campaigns

List advertising campaigns for a TikTok advertiser. Returns campaign IDs, names, status, and budgets.

Operation
Read read
Schema command
kosmo integrations:schema tiktok.tiktok_list_campaigns --json
ParameterTypeRequiredDescription
advertiser_id string yes The TikTok advertiser ID.
page integer no Page number for pagination. Defaults to 1.
page_size integer no Number of campaigns per page. Defaults to 10.

tiktok.tiktok_get_campaign

Get details for a specific TikTok advertising campaign, including budget, schedule, and performance.

Operation
Read read
Schema command
kosmo integrations:schema tiktok.tiktok_get_campaign --json
ParameterTypeRequiredDescription
advertiser_id string yes The TikTok advertiser ID.
campaign_id string yes The TikTok campaign ID.

tiktok.tiktok_list_advertisers

List advertisers accessible to the authenticated TikTok Business user. Returns advertiser IDs, names, and company details.

Operation
Read read
Schema command
kosmo integrations:schema tiktok.tiktok_list_advertisers --json
ParameterTypeRequiredDescription
app_id string no The TikTok app ID to filter advertisers by.
secret string no The TikTok app secret to filter advertisers by.

tiktok.tiktok_get_current_user

Get the authenticated user's TikTok Business account information, including display name, email, and status.

Operation
Read read
Schema command
kosmo integrations:schema tiktok.tiktok_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.