Campaigns, ad groups and ads
Use these calls when you want control over each level. To promote one post quickly, /boost does the three steps in one call.
Every call takes the ad account as explained in Choosing the ad account. All examples send profile_username.
Campaigns
Create
POST /api/uploadposts/ads/tiktok/campaigns
| Name | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Up to 512 characters. |
goal | String | Yes | reach, video_views, traffic or followers. Its ad groups must use the same goal. |
budget | Object | No | {"amount": 100, "type": "daily" | "lifetime"}. Without it the campaign has no limit and the budget lives in its ad groups. |
status | String | No | paused (default) or active. |
idempotency_key | String | No | A retry with the same key within 10 minutes answers 409 instead of creating it twice. |
curl -X POST https://api.upload-post.com/api/uploadposts/ads/tiktok/campaigns \
-H 'Authorization: Apikey your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{"profile_username": "my-profile", "name": "Summer collection", "goal": "video_views"}'
{
"success": true,
"campaign_id": "1800000000000000001",
"campaign": { "campaign_id": "1800000000000000001", "campaign_name": "Summer collection", "objective_type": "VIDEO_VIEWS", "budget_mode": "BUDGET_MODE_INFINITE", "operation_status": "DISABLE" }
}
campaign is TikTok's own answer (shortened here).
List
GET /api/uploadposts/ads/tiktok/campaigns
Returns the campaigns as TikTok has them, including the ones made in TikTok Ads Manager. Filters: ids (comma-separated, up to 100), page, page_size (default 50).
curl -G https://api.upload-post.com/api/uploadposts/ads/tiktok/campaigns \
-H 'Authorization: Apikey your-api-key-here' \
--data-urlencode 'profile_username=my-profile'
{
"success": true,
"campaigns": [
{ "campaign_id": "1800000000000000001", "campaign_name": "Summer collection", "objective_type": "VIDEO_VIEWS", "operation_status": "DISABLE", "budget_mode": "BUDGET_MODE_INFINITE" }
],
"page_info": { "page": 1, "page_size": 50, "total_number": 1, "total_page": 1 }
}
Ad groups
The ad group holds the budget, the schedule and who sees the ads.
Create
POST /api/uploadposts/ads/tiktok/adgroups
| Name | Type | Required | Description |
|---|---|---|---|
campaign_id | String | Yes | The campaign. |
name | String | Yes | Up to 512 characters. |
goal | String | Yes | The campaign's goal. |
budget | Object | Yes | {"amount": 20, "type": "daily"}. type: daily (default) or lifetime (needs schedule.end_date). TikTok's minimum is about 20 EUR a day. |
targeting | Object | Yes | countries (ISO codes) or location_ids, plus optional age, gender, interests, languages and audiences. Same fields as the boost targeting. |
schedule | Object | No | start_date, end_date (YYYY-MM-DD, UTC, or ISO 8601). Default: from now, no end. |
frequency, frequency_schedule | Integer | No | reach only: default 3 impressions every 7 days per person. |
status | String | No | paused (default) or active. |
idempotency_key | String | No | Same as for campaigns. |
Ads run on the TikTok app placement.
curl -X POST https://api.upload-post.com/api/uploadposts/ads/tiktok/adgroups \
-H 'Authorization: Apikey your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"profile_username": "my-profile",
"campaign_id": "1800000000000000001",
"name": "Spain 18-34",
"goal": "video_views",
"budget": {"amount": 25, "type": "daily"},
"targeting": {"countries": ["ES"], "age_min": 18, "age_max": 34}
}'
{
"success": true,
"adgroup_id": "1800000000000000002",
"adgroup": { "adgroup_id": "1800000000000000002", "adgroup_name": "Spain 18-34", "budget": 25.0, "operation_status": "DISABLE" }
}
List
GET /api/uploadposts/ads/tiktok/adgroups
Filters: ids, campaign_id (comma-separated), page, page_size. Answers adgroups and page_info, like the campaign list.
Ads
An ad promotes a post of the TikTok account linked to your ad account (a Spark Ad). Get identity_id and post_id as in Boost a post.
Create
POST /api/uploadposts/ads/tiktok/ads
| Name | Type | Required | Description |
|---|---|---|---|
adgroup_id | String | Yes | The ad group. |
name | String | Yes | Up to 512 characters. |
identity_id | String | Yes | The TikTok account (GET /identities). |
post_id | String | Yes | The post (item_id of GET /spark/posts?identity_id=). |
goal | String | No | The campaign's goal. Send traffic to require landing_page_url, and followers to allow VIEW_PROFILE. |
landing_page_url | String | No | Website the ad links to. |
call_to_action | String | No | Button. Only with landing_page_url (default LEARN_MORE when there is one). |
status | String | No | paused (default) or active. |
identity_type | String | No | TT_USER (default). |
idempotency_key | String | No | Same as for campaigns. |
The ad's text is the post's caption: there is no text field for it.
curl -X POST https://api.upload-post.com/api/uploadposts/ads/tiktok/ads \
-H 'Authorization: Apikey your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"profile_username": "my-profile",
"adgroup_id": "1800000000000000002",
"name": "Summer video",
"identity_id": "5f39abca-0000-4000-8000-000000000001",
"post_id": "7311111111111111111",
"landing_page_url": "https://example.com/summer",
"call_to_action": "SHOP_NOW"
}'
{
"success": true,
"ad_id": "1800000000000000003",
"ad_ids": ["1800000000000000003"],
"need_audit": true
}
need_audit: true means TikTok reviews the ad before it runs.
Other ways to make an ad, less common: a post authorized with a code from the TikTok app (post_auth_code instead of identity_id + post_id), or a new video that is not on the TikTok profile (identity_id, video_id and a cover image_id from creatives, and ad_text up to 100 characters).
List
GET /api/uploadposts/ads/tiktok/ads
Filters: ids, campaign_id, adgroup_id, page, page_size. Answers ads and page_info.
Edit
PATCH /api/uploadposts/ads/tiktok/campaigns/{campaign_id}
PATCH /api/uploadposts/ads/tiktok/adgroups/{adgroup_id}
PATCH /api/uploadposts/ads/tiktok/ads/{ad_id}
Only the fields you send change. Status is changed with pause, resume and delete, not here.
| Level | Fields |
|---|---|
| Campaign | name, budget (a number, or {"amount": n}), only if the campaign has its own daily or lifetime budget |
| Ad group | name, budget. TikTok requires at least 105% of what the ad group already spent. |
| Ad | name. ad_text only on ads made from a new video (it sends the ad to TikTok's review again). |
curl -X PATCH https://api.upload-post.com/api/uploadposts/ads/tiktok/adgroups/1800000000000000002 \
-H 'Authorization: Apikey your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{"profile_username": "my-profile", "budget": 40}'
{
"success": true,
"message": "Adgroup updated.",
"adgroup_id": "1800000000000000002",
"changed": { "budget": 40.0 },
"result": {}
}
Two answers to expect:
- A campaign with no budget of its own (every boost campaign, and any campaign created without
budget) answers400campaign_without_budget: change the budget of its ad groups. ad_texton an ad that promotes an existing post answers400tiktok_ads_spark_text_fixed: its text is the post's caption.
Pause, resume and delete
POST /api/uploadposts/ads/tiktok/{campaigns|adgroups|ads}/{id}/pause
POST /api/uploadposts/ads/tiktok/{campaigns|adgroups|ads}/{id}/resume
POST /api/uploadposts/ads/tiktok/{campaigns|adgroups|ads}/{id}/delete
- Resume can start spending right away.
- Delete cannot be undone: send
{"confirm": true}, otherwise400confirmation_required. - Pausing a campaign stops everything under it.
curl -X POST https://api.upload-post.com/api/uploadposts/ads/tiktok/campaigns/1800000000000000001/resume \
-H 'Authorization: Apikey your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{"profile_username": "my-profile"}'
{
"success": true,
"message": "Campaign resumed.",
"campaign_id": "1800000000000000001",
"result": { "campaign_ids": ["1800000000000000001"] }
}
curl -X POST https://api.upload-post.com/api/uploadposts/ads/tiktok/ads/1800000000000000003/delete \
-H 'Authorization: Apikey your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{"profile_username": "my-profile", "confirm": true}'
{ "success": true, "message": "Ad deleted.", "ad_id": "1800000000000000003", "result": { "ad_ids": ["1800000000000000003"] } }
An id that is not in the ad account answers 404.
Next: Reports.