Turn Spark-Ads authorization on or off for the brand’s own post
set_tiktok_post_ad_authorizationEnable or disable TikTok Ad authorization on your post to generate a Spark Ads code; requires confirmation when enabling and fails to disable if an active Spark Ad uses the post.
Instructions
Turn TikTok's 'Ad authorization' setting ON or OFF for a post the authorized account owns — THIS IS WHERE A SPARK ADS AUTHORIZATION CODE COMES FROM. Until now the only way to get one was a human opening the TikTok app and copying a string; that is still true for somebody ELSE's post, and no longer true for the brand's own. Turning it on mints the code, which you then hand to authorize_tiktok_ads_spark_post so an ad account may promote the post. IT IS CONFIRM-GATED ON THE WAY ON, and not because it spends: TikTok changes the post's privacy to 'Available for Ads', sends it to their ad review team, says the post 'may also appear as an ad on third party platforms', and treats the call as accepting their Advertising Content Terms on the owner's behalf. Turning it OFF needs no confirm — but TikTok REFUSES to turn it off while an active Spark Ad is using the post, so pause those campaigns first. authorizationDays must be one of 7, 30, 60, 180, 365. THE ANSWER IS THE READ-BACK: the reply carries the post's real authorization status and its code, because TikTok's own response body is empty. NEEDS THE TIKTOK ACCOUNT AUTHORIZATION (see tiktok_account_status).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| itemId | Yes | the TikTok post id | |
| confirm | No | REQUIRED true when enabling — it makes the post publicly promotable and accepts TikTok’s advertising terms on the owner’s behalf | |
| enabled | Yes | true turns Ad authorization ON (and mints the Spark Ads code); false turns it off | |
| authorizationDays | No | 7 | 30 | 60 | 180 | 365 — TikTok publishes exactly those five; default 30 |