TikTok Ads
Advertiser info, campaigns, ad groups, ads, integrated reports, Instant Form leads (opt-in), agent enable/disable and capped budget changes after opt-in, creates and deletes node only
Beta v0.1.0 Node.js 22 actions ToS risk low
About
A Graphrt plugin for the TikTok API for Business (Marketing API v1.3, https://business-api.tiktok.com/open_api/v1.3). It reads advertiser info, campaigns, ad groups, ads and integrated reports, retrieves Instant Form leads, and changes status and budgets. It is built with the declarative REST layer (definition.mjs) plus small agent-safety wrappers in lib/.
What it can do
- Reads: get_advertiser_info (name, status, currency, time zone, balance), list_campaigns, list_ad_groups, list_ads (with fields and filtering), get_report (synchronous report/integrated/get: report type, data level, dimensions, metrics, dates or lifetime, filtering, sorting, total metrics)
- Leads: list_lead_forms (Instant Forms), get_lead_form_fields, get_lead, create_lead_download_task (start or check an export of every lead of a form or ad), download_leads (saves the CSV/zip)
- Changes: set_campaign_status, set_ad_group_status, set_ad_status (ENABLE / DISABLE, up to 20 ids), set_campaign_budget, set_ad_group_budgets (lifetime budget now, or daily scheduled_budget from tomorrow)
- Node only: create_campaign, create_ad_group, create_ad (the request body as in TikTok's docs), delete_campaigns, delete_ad_groups, delete_ads
- api_request: any other endpoint (GET only and allowlisted paths for agents), e.g. /pixel/list/
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Advertiser info
tiktok-ads.get_advertiser_info - Campaigns
tiktok-ads.list_campaigns - Ad groups
tiktok-ads.list_ad_groups - Ads
tiktok-ads.list_ads - Integrated report
tiktok-ads.get_report - List Instant Forms
tiktok-ads.list_lead_forms - Instant Form fields
tiktok-ads.get_lead_form_fields - Get lead
tiktok-ads.get_lead - Lead download task
tiktok-ads.create_lead_download_task - Campaign status
tiktok-ads.set_campaign_status
Show all 22 actions
- Ad group status
tiktok-ads.set_ad_group_status - Ad status
tiktok-ads.set_ad_status - Campaign budget
tiktok-ads.set_campaign_budget - Ad group budgets
tiktok-ads.set_ad_group_budgets - Create campaign
tiktok-ads.create_campaign - Create ad group
tiktok-ads.create_ad_group - Create ad
tiktok-ads.create_ad - Delete campaigns
tiktok-ads.delete_campaigns - Delete ad groups
tiktok-ads.delete_ad_groups - Delete ads
tiktok-ads.delete_ads - TikTok API for Business request
tiktok-ads.api_request - Download leads
tiktok-ads.download_leads
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
TIKTOK_ADS_ACCESS_TOKENRequiredMarketing API access token, sent as the Access-Token header -
TIKTOK_ADS_TOOL_ALLOW_WRITESOptional1 lets agent tools enable/disable campaigns, ad groups and ads and change budgets, see the two rows below -
TIKTOK_ADS_TOOL_ADVERTISER_IDSFor any agent writeComma-separated advertiser ids agents may change. Unset refuses every agent write -
TIKTOK_ADS_TOOL_MAX_BUDGETFor agent budget changes and ENABLEHighest total budget per agent call, and highest budget an object may have to be enabled by an agent, in the account currency's units (not cents). Unset or 0 refuses every agent budget change and ENABLE -
TIKTOK_ADS_TOOL_ALLOW_LEADSOptional1 lets agent tools read leads (personal data): get_lead, create_lead_download_task, download_leads -
TIKTOK_ADS_LEADS_DIRFor download_leadsAbsolute directory where lead files are saved -
TIKTOK_ADS_TOOL_API_EXTRA_PATHSOptionalMore GET paths agents may reach with api_request, comma-separated, * = one segment -
TIKTOK_ADS_TOOL_TOKEN_SOURCE
How to use it
In Graphrt Desktop
- Open Plugins and search for TikTok Ads.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install tiktok-ads workflow.yaml
- id: report type: tiktok-ads.get_report advertiser_id: "7000000000000000001" data_level: AUCTION_AD dimensions: [ad_id] metrics: [spend, impressions, clicks, conversion] start_date: "2026-11-01" end_date: "2026-11-18" - id: pause type: tiktok-ads.set_campaign_status advertiser_id: "7000000000000000001" campaign_ids: ["1800000000000000001"] operation_status: DISABLE - id: budget type: tiktok-ads.set_campaign_budget advertiser_id: "7000000000000000001" campaign_id: "1800000000000000001" budget: 75.5 # USD 75.50 on a USD account