Skip to content

TikTok Ads

Your agent promotes the TikTok clip that beat your median views, signed in as you, and reads what each ad spent and earned.

Connect
Sign in once, 3 grants
First run
Read the ads running on your category’s words, about 0.2¢
Sites
TikTok
Campaign.create
You, to your agent

Turn my late-rent clip into a Spark Ad at $25 a day for 7 days, and show me what TikTok would accept.

curl -X POST "https://api.sb/leaseline.app/campaigns/create?mode=try" \
  -H "Authorization: Bearer $SB_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"venue":"tiktok","objective":"traffic","budget":{"amount":25,"currency":"USD","per":"day"},"days":7,"ads":["posts/tiktok-late-rent"]}'
npx startup-builder do Campaign.create --try --data '{"venue":"tiktok","objective":"traffic","budget":{"amount":25,"currency":"USD","per":"day"},"days":7,"ads":["posts/tiktok-late-rent"]}'
{
  "name": "do",
  "arguments": {
    "mode": "try",
    "code": "return await $.Campaign.create({ venue: 'tiktok', objective: 'traffic', budget: { amount: 25, currency: 'USD', per: 'day' }, days: 7, ads: ['posts/tiktok-late-rent'] })"
  }
}
import { $ } from 'startup-builder'

const result = await $.try.Campaign.create({ venue: 'tiktok', objective: 'traffic', budget: { amount: 25, currency: 'USD', per: 'day' }, days: 7, ads: ['posts/tiktok-late-rent'] })
Response
{
  "$type": "Campaign",
  "mode": "try",
  "stored": false,
  "venue": "tiktok",
  "format": "Spark Ad",
  "adGroupBudget": {
    "amount": 25,
    "currency": "USD",
    "per": "day"
  },
  "campaignBudget": "unset",
  "total": {
    "amount": 175,
    "currency": "USD"
  },
  "checks": {
    "adGroupFloor": "over the $20 floor"
  },
  "runsBy": "browser",
  "steps": 16
}
Try mode reads, stores nothing and spends nothingAPI referenceIts Nouns

Connect once

  1. Call Integration.connect with system: 'ads' and venue: 'tiktok', then open the connectUrl it returns and sign in as yourself with TikTok for Business.
  2. Authorize the ad account, then sign in once more in the browser window the platform opens; that saved session builds the Spark Ads.
  3. Set the spend on your standing approval with Mandate.authorize; TikTok bills your ad account, never the platform.
GrantWhat it unlocksScope
Read your ad accountCampaigns, ad groups with their bids and targeting, and ads with their creative and landing pageAd Account Management
Read resultsSpend, impressions, clicks and conversions by adReporting
Your saved sessionSpark Ads built from your own clips, and budget changes, in TikTok Ads Managerbrowser session: ads.tiktok.com
ToDo this
PauseIntegration.pause stops every call through TikTok at once and keeps the token; Integration.resume picks up from the same cursor.
ReconnectIntegration.reconnect returns a fresh connectUrl that lasts one hour, and keeps the Integration's id and cursor, so nothing imports twice.
DisconnectIntegration.revoke revokes the token with TikTok; every record it brought in stays in your records.

What your agents do

AskVerbRuns throughPrice
Turn my late-rent clip into a Spark Ad at $25 a day for 7 days, signed in as me.Campaign.createA browser agentAbout 1.6¢ a step
Add my second-best clip to the same ad group, signed in as me.Ad.createA browser agentAbout 1.6¢ a step
Pause the clip with the higher cost per landing-page view, signed in as me.Campaign.updateA browser agentAbout 1.6¢ a step
Show me spend, views and cost per landing-page view by ad this week.Metric.queryYour accountFree

Calls on your own account are free; TikTok bills your spend directly.

Reading this site’s public data needs no account: Ad.find is a Data call (the three ways a call runs).

What it holds

NounThe account’s objectWhenWhich side leads
Campaigncampaign and ad groupYour agent builds itYour records
AdSpark AdYour agent builds it; TikTok’s review sets its statusYour records
Entryreport: spendEach day’s spend settlesThe account

Events and webhooks

DirectionEvent
EmitsCampaign.created, Campaign.updated, Ad.created, Entry.posted

Any Event can wake a Workflow, and a Watch delivers it to your endpoint, signed (Events and webhooks).

Limits

WhatLimitCall
Budget minimumsAn ad group’s daily budget must exceed $20, and a campaign’s daily budget, when you set one, must exceed $50Campaign.create
Spark AdsPromote a post already on your TikTok account, with its likes and comments keptAd.create
Ad reviewTikTok reviews every ad; a rejection comes back as venue-rejected with the reasonAd.create
SpendYour standing approval holds the cap; a change past it waits with over-mandateCampaign.update

Start here

MoveThe rule
StructureOne campaign with no campaign budget, one ad group, and Spark Ads from the 2 clips that beat your median views by 3 times.
BudgetThe ad group floor sets the test: its daily budget must exceed $20, so $25 a day for 7 days is $175. Set no campaign budget, or more than $50 a day if you set one.
CreativeSpark Ads from your own posts, so your handle, likes and comments carry over; vertical, with the problem said in the first 2 seconds.
Kill ruleAt day 7, keep the clip with the lower cost per landing-page view; with no signup at $175, stop both and go back to posting.
BenchmarkSource
Ad group daily budget over $20; campaign daily budget over $50 when one is setTikTok Ads Manager help
7 days at $25 a day is $175Our calculation
Promote a clip only at 3 times your median viewsOur planning number

Field map

Our fieldTikTok Ads’s fieldNotesCalls
Campaign.objectivecampaign objective_typetraffic is TRAFFIC; leads is LEAD_GENERATION with TikTok’s instant form; conversions is WEB_CONVERSIONS on your pixelCampaign.create, Campaign.update, Ad.create
Campaign.budgetadgroup budget with budget_mode BUDGET_MODE_DAYOver $20; the campaign budget stays unset unless you ask, and then it is over $50Campaign.create, Campaign.update, Ad.create
Campaign.startsAtadgroup schedule_start_timeNone.Campaign.create
Campaign.endsAtadgroup schedule_end_timeSet with schedule_type SCHEDULE_START_ENDCampaign.create, Campaign.update
Campaign.stateadgroup operation_statuslive is ENABLE, paused DISABLECampaign.update
Campaign.targetingadgroup location_ids, age_groups and interest_category_idsTikTok targets people, not job titles: an interest stands in for a roleCampaign.create
Campaign.bidadgroup bid_typelowest-cost is BID_TYPE_NO_BID; a costPer cap is BID_TYPE_CUSTOM with bid_priceCampaign.create
Ad.mediaad tiktok_item_idA Spark Ad: your own post, authorized for the ad, keeping its likes and commentsAd.create
Ad.callToActionad call_to_actionSuch as LEARN_MORE or SIGN_UPAd.create
Ad.landingUrlad landing_page_urlNone.Ad.create

What try does here

Returns the Spark Ad and its ad group as Ads Manager will hold them, checked against TikTok’s budget floors, with the steps the browser agent would take; nothing is created.

How long a connection lasts

A connection lasts 365 days from your first sign-in, the life of TikTok’s refresh token; the platform renews the 24-hour access token on its own.

The platform asks you to reconnect 7 days before it runs out; until you do, a call that needs it refuses with needs-reauth.

Formats

SiteFormatSizeLimits
TikTokVideoNone.Caption 2,200 characters, hashtags included; length up to what your account reports
TikTokSpark AdNone.A post already on your account, promoted with its likes and comments kept

Plays and strategies

KindWhere
PlaysPaid social, Creator ads, Promote winners
StrategiesPaid

Used by

No Workflow, agent task or Service acts through it yet: your agents call it directly.

Reference

4 calls, each with its path and price
CallPathPrice
Campaign.createPOST /campaigns/createAbout 1.6¢ a step
Ad.createPOST /ads/createAbout 1.6¢ a step
Campaign.updatePOST /campaigns/updateAbout 1.6¢ a step
Metric.queryPOST /metrics/queryFree

Contents