Skip to main content

Targeting, audiences and creatives

Lookups and assets for the targeting of an ad group or a boost. Every call takes the ad account as explained in Choosing the ad account.

Countries​

GET /api/uploadposts/ads/tiktok/locations?goal=reach

The countries TikTok can deliver a goal to, with TikTok's location_id. goal is reach (default), video_views, traffic or followers. Send the ISO codes as targeting.countries, or the ids as targeting.location_ids.

curl -G https://api.upload-post.com/api/uploadposts/ads/tiktok/locations \
-H 'Authorization: Apikey your-api-key-here' \
--data-urlencode 'goal=video_views'
{
"success": true,
"goal": "video_views",
"countries": [
{ "country": "ES", "location_id": "2510769" },
{ "country": "MX", "location_id": "3996063" }
]
}

A country that is not in the list answers 400 tiktok_ads_location_unavailable when you create the ad group or boost, with the refused codes in details.countries.

Interests​

GET /api/uploadposts/ads/tiktok/interests?language=en

TikTok's interest categories, for targeting.interest_category_ids. language defaults to en.

{
"success": true,
"count": 2,
"interest_categories": [
{ "interest_category_id": "17", "name": "Apparel & Accessories", "level": 1, "sub_category_ids": ["1701", "1702"] },
{ "interest_category_id": "1701", "name": "Women's Clothing", "level": 2, "sub_category_ids": [] }
]
}

Countries and interests are kept for 7 days.

Audiences​

Your own lists of people, for targeting.audience_ids (show to them) or targeting.excluded_audience_ids (leave them out).

List​

GET /api/uploadposts/ads/tiktok/audiences

Custom and lookalike audiences of the ad account, also the ones shared with it. page, page_size (up to 100).

From emails or phone numbers​

POST /api/uploadposts/ads/tiktok/audiences/customer-file
NameTypeRequiredDescription
nameStringYesUp to 128 characters.
identifier_typeStringYesemail or phone.
identifiersString[]Yes1 to 100,000 emails, or phones in E.164 (+34600112233). Values already SHA-256 hashed (64 hex characters) are accepted.
retention_in_daysIntegerNo1-365.

Upload-Post normalizes each value (emails in lower case, phones in E.164) and hashes it with SHA-256 before sending it to TikTok. The plain values are never stored or logged.

curl -X POST https://api.upload-post.com/api/uploadposts/ads/tiktok/audiences/customer-file \
-H 'Authorization: Apikey your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{"profile_username": "my-profile", "name": "Newsletter", "identifier_type": "email", "identifiers": ["[email protected]", "[email protected]"]}'
{
"success": true,
"custom_audience_id": "6900000000000000001",
"identifiers_uploaded": 2,
"message": "Audience created. TikTok needs 30-60 minutes to process it and at least 1,000 matched people to target it."
}

Lookalike​

POST /api/uploadposts/ads/tiktok/audiences/lookalike

People similar to an existing audience.

NameTypeRequiredDescription
nameStringYesUp to 128 characters.
source_audience_idStringYesAn audience that is not a lookalike itself.
countriesString[]YesISO country codes.
audience_sizeStringNoNARROW, BALANCED (default) or BROAD.
include_sourceBooleanNoAlso include the source audience (default false).
mobile_osStringNoALL (default), IOS or ANDROID.
{ "success": true, "custom_audience_id": "6900000000000000002" }

Delete​

POST /api/uploadposts/ads/tiktok/audiences/{audience_id}/delete

Cannot be undone: send {"confirm": true}, otherwise 400 confirmation_required.

{ "success": true, "message": "Audience deleted.", "custom_audience_id": "6900000000000000001" }

Creatives​

Only needed for an ad made from a new video that is not on the TikTok profile. To promote a post that is already on TikTok you do not upload anything.

POST /api/uploadposts/ads/tiktok/creatives/videos   { "video_url": "https://..." }
POST /api/uploadposts/ads/tiktok/creatives/images { "image_url": "https://..." }

TikTok downloads the file into the ad account's library and returns its id. Optional file_name (up to 100 characters).

curl -X POST https://api.upload-post.com/api/uploadposts/ads/tiktok/creatives/videos \
-H 'Authorization: Apikey your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{"profile_username": "my-profile", "video_url": "https://example.com/ad.mp4"}'
{ "success": true, "video_id": "v10033g50000example", "creative": { "video_id": "v10033g50000example" } }

Use video_id, an image id as the cover (image_id) and ad_text in Create an ad.