> ## Documentation Index
> Fetch the complete documentation index at: https://www.ayrshare.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Boost Post

> Promote a TikTok video as a Spark Ad

Promote a TikTok video as a Spark Ad. The ad runs the video as it is, under its creator's account, and the video keeps its likes, comments and follows. Ayrshare creates a campaign, an ad group and an ad in your TikTok ad account.

<ul>
  <li>Link TikTok, then connect a TikTok ad account from the dashboard. The ad runs from that ad account.</li>
  <li>For a video from your linked TikTok account, you do not need a code. If that TikTok account is linked to your ad account in TikTok, the ad runs as it. Otherwise Ayrshare creates the Spark Ads code for you.</li>
  <li>For another creator's video, the creator generates a Spark Ads code in the TikTok app and gives it to you. Send it in `platformOptions.tiktok.sparkAuthCode`. The code must be for the video you boost, or the answer is `code: 101`.</li>
  <li>The budget is set on the ad group, in your ad account's currency. Do not send `budget.currency` or `budget.level: "campaign"`.</li>
  <li>The smallest budget is 20 a day in your ad account's currency. A lifetime budget is at least 20 for each scheduled day.</li>
  <li>The video stays on the creator's profile while the ad runs. Send `platformOptions.tiktok.adsOnly: true` to show it as an ad only.</li>
  <li>If you send requests faster than TikTok allows, the answer is `code: 364` with HTTP 429 and TikTok's message in `details`. Wait a minute and retry with a new `idempotencyKey`.</li>
  <li>Ads are included with Premium, Business and Enterprise plans, as on the [Ads overview](https://www.ayrshare.com/docs/apis/ads/overview.md). On another plan the answer is `code: 169`.</li>
  <li>If TikTok removes Ayrshare's access to your ad account, the answer is `code: 420` with HTTP 401 and the `ads` webhook sends `accountRevoked`. Connect the TikTok ad account again from the dashboard.</li>
  <li>TikTok ads are turned on per account. Contact us to enable them.</li>
</ul>

### What TikTok Supports

| Option | TikTok |
| - | - |
| Goals | `brand_awareness`, `video_views`, `traffic` |
| Budget | `daily` or `lifetime`, on the ad group |
| Targeting | Countries, regions and cities, age bands, gender, interests |
| Not supported | `targeting.keywords`, `targeting.audiences`, `targeting.excludedLocations`, `attachTo`, messaging buttons |
| Ad status updates | `ACTIVE`, `PAUSED`, `DELETED` |

### Ad Goals

<ul>
  <li>`brand_awareness`: show the video to as many people as possible.</li>
  <li>`video_views`: get more views of the video.</li>
  <li>`traffic`: send people to your website. Needs `callToAction` with a link.</li>
</ul>

## Header Parameters

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string`

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## Body Parameters

**accountId** `string` *required*

Your TikTok ad account (advertiser) ID, for example `7100000000000000001`. It must be an ad account you connected.

**postId** `string`

The Ayrshare post ID to boost. Send `postId` or `socialPostId`.

**socialPostId** `string`

The TikTok video ID to boost.

**goal** `string` *required*

One of the [ad goals](#ad-goals).

**budget** `object` *required*

**child attributes**

**amount** `number` *required*

Amount to spend, at least 20, up to two decimal places.

**type** `string` (default: daily)

`daily` or `lifetime`. A lifetime budget needs `schedule.end`.

**schedule** `object`

**child attributes**

**start** `string`

ISO date-time the ad starts. Defaults to now.

**end** `string`

ISO date-time the ad stops. Leave it out to run until you pause it.

**targeting** `object` *required*

**child attributes**

**locations** `object` *required*

Where to show the ad: two-letter country codes under `countries`, or location IDs from `GET /ads/tiktok/regions?search=<term>` under `regions` or `cities`.

```json theme={"system"}
{ "countries": ["US"], "regions": [{ "key": "5332921" }] }
```

**ageMin** `number`

The start of one of TikTok's age bands: 18, 25, 35, 45 or 55.

**ageMax** `number`

The end of one of TikTok's age bands: 24, 34, 44, 54, or 65 for 55 and over.

**genders** `string`

`all`, `male` or `female`.

**interests** `array`

Interest category IDs from `GET /ads/tiktok/interests?search=<term>`.

**callToAction** `object`

Required for the `traffic` goal.

**child attributes**

**type** `string` *required*

`LEARN_MORE`, `SHOP_NOW`, `SIGN_UP`, `CONTACT_US`, `APPLY_NOW`, `BOOK_NOW`, `DOWNLOAD_NOW`, `GET_QUOTE`, `ORDER_NOW`, `SUBSCRIBE`, `WATCH_NOW` or `READ_MORE`.

**link** `string`

The page to open. Required for the `traffic` goal.

**status** `string` (default: active)

`active` or `paused`.

**idempotencyKey** `string`

A unique, non-empty key for this boost request. Retry the same payload with the same key to avoid creating a duplicate ad: the first answer is replayed, including an error. Reusing the key with a different payload returns HTTP 409. The key applies to this platform only: the same key on another platform starts a separate boost. A request still in progress also returns 409; an unavailable reservation returns 503 without creating an ad.

**platformOptions.tiktok** `object`

**child attributes**

**sparkAuthCode** `string`

The Spark Ads code the video's creator generated in the TikTok app for this video. Required for a video that is not from your linked TikTok account.

**adsOnly** `boolean` (default: false)

`true` shows the video as an ad only, not on the creator's profile.

```bash cURL theme={"system"}
curl -X POST https://api.ayrshare.com/api/ads/tiktok/boost \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "accountId": "7100000000000000001",
    "socialPostId": "7400000000000000001",
    "goal": "brand_awareness",
    "budget": { "amount": 20, "type": "daily" },
    "targeting": { "locations": { "countries": ["US"] } },
    "platformOptions": { "tiktok": { "sparkAuthCode": "#AbCdEf123" } }
  }'
```

```json 200: Video Boosted theme={"system"}
{
  "status": "success",
  "id": "1800000000000000003",
  "platform": "tiktok",
  "adStatus": "ACTIVE",
  "budget": { "amount": 20, "type": "daily", "level": "adSet", "currency": "USD" },
  "schedule": { "start": 1792584000000 },
  "platformIds": {
    "campaignId": "1800000000000000001",
    "adGroupId": "1800000000000000002",
    "adId": "1800000000000000003"
  }
}
```

```json 400: Code for another video theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "platformOptions.tiktok.sparkAuthCode is for TikTok video 7400000000000000002, not the boosted post 7400000000000000001."
}
```

```json 400: Budget too small theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "budget.amount on tiktok is at least 20 in the ad account's currency."
}
```

```json 401: Ad account access removed theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 420,
  "message": "Ads permissions missing for this social account. Please unlink the account and relink it in the social account linking page, granting all ads permissions.",
  "details": "Relink tiktok and grant the ads permissions to use ads on tiktok."
}
```

```json 429: Rate limited theme={"system"}
{
  "action": "rate limit",
  "status": "error",
  "code": 364,
  "message": "You are making too many requests. Please reduce the number of requests.",
  "details": "Too many requests. Please retry in some time."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.