> ## 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.

# 投稿をブースト

> 動画を Spark Ad で宣伝。Ayrshare が TikTok 広告アカウントにキャンペーン・広告グループ・広告を作成、目標・予算・ターゲティングを設定。

TikTok 動画を Spark Ad として宣伝します。広告は動画をそのまま、作成者のアカウントの名義で配信し、動画のいいね、コメント、フォローはそのまま保持されます。Ayrshare は TikTok 広告アカウントにキャンペーン、広告グループ、広告を作成します。

<ul>
  <li>TikTok をリンクしてから、ダッシュボードで TikTok 広告アカウントを接続します。広告はその広告アカウントから配信されます。</li>
  <li>リンク済みの TikTok アカウントの動画にはコードは不要です。その TikTok アカウントが TikTok 上で広告アカウントにリンクされている場合、広告はそのアカウントとして配信されます。それ以外の場合は、Ayrshare が Spark Ads コードを作成します。</li>
  <li>他の作成者の動画の場合、作成者が TikTok アプリで Spark Ads コードを生成してあなたに渡します。それを `platformOptions.tiktok.sparkAuthCode` で送信してください。コードはブーストする動画のものである必要があり、そうでない場合のレスポンスは `code: 101` です。</li>
  <li>予算は広告グループに、広告アカウントの通貨で設定されます。`budget.currency` や `budget.level: "campaign"` は送信しないでください。</li>
  <li>最小予算は広告アカウントの通貨で 1 日あたり 20 です。通算予算は、予定された 1 日ごとに 20 以上です。</li>
  <li>広告の配信中も、動画は作成者のプロフィールに残ります。広告としてのみ表示するには `platformOptions.tiktok.adsOnly: true` を送信してください。</li>
  <li>TikTok が許可するより速くリクエストを送信すると、レスポンスは HTTP 429 の `code: 364` となり、`details` に TikTok のメッセージが含まれます。1 分待ってから、新しい `idempotencyKey` で再試行してください。</li>
  <li>[Ads の概要](https://www.ayrshare.com/docs/ja/apis/ads/overview.md)に記載のとおり、広告は Premium Plan、Business Plan、Enterprise Plan に含まれます。他のプランでのレスポンスは `code: 169` です。</li>
  <li>TikTok があなたの広告アカウントへの Ayrshare のアクセスを取り消すと、レスポンスは HTTP 401 の `code: 420` となり、`ads` webhook が `accountRevoked` を送信します。ダッシュボードで TikTok 広告アカウントを再接続してください。</li>
  <li>TikTok 広告はアカウントごとに有効化されます。有効化するにはお問い合わせください。</li>
</ul>

### TikTok がサポートする内容

| オプション | TikTok |
| - | - |
| 目標 | `brand_awareness`, `video_views`, `traffic` |
| 予算 | `daily` または `lifetime`、広告グループに設定 |
| ターゲティング | 国、地域、都市、年齢層、性別、興味関心 |
| 非対応 | `targeting.keywords`、`targeting.audiences`、`targeting.excludedLocations`、`attachTo`、メッセージボタン |
| 広告ステータスの更新 | `ACTIVE`, `PAUSED`, `DELETED` |

### 広告の目標

<ul>
  <li>`brand_awareness`: できるだけ多くの人に動画を表示します。</li>
  <li>`video_views`: 動画の再生数を増やします。</li>
  <li>`traffic`: ウェブサイトに人を誘導します。リンク付きの `callToAction` が必要です。</li>
</ul>

## ヘッダーパラメータ

**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`

## ボディパラメータ

**accountId** `string` *required*

TikTok 広告アカウント (広告主) の ID。例: `7100000000000000001`。接続済みの広告アカウントである必要があります。

**postId** `string`

ブーストする Ayrshare の投稿 ID。`postId` または `socialPostId` を送信してください。

**socialPostId** `string`

ブーストする TikTok 動画の ID。

**goal** `string` *required*

[広告の目標](#ad-goals)のいずれか。

**budget** `object` *required*

**子属性**

**amount** `number` *required*

支出額。20 以上、小数点以下 2 桁まで。

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

`daily` または `lifetime`。通算予算には `schedule.end` が必要です。

**schedule** `object`

**子属性**

**start** `string`

広告を開始する ISO 日時。デフォルトは現在です。

**end** `string`

広告を終了する ISO 日時。省略すると、一時停止するまで配信されます。

**targeting** `object` *required*

**子属性**

**locations** `object` *required*

広告を表示する場所: `countries` に 2 文字の国コード、または `regions` か `cities` に `GET /ads/tiktok/regions?search=<term>` から取得した地域 ID を指定します。

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

**ageMin** `number`

TikTok の年齢層のいずれかの開始値: 18、25、35、45、55。

**ageMax** `number`

TikTok の年齢層のいずれかの終了値: 24、34、44、54、または 55 歳以上の場合は 65。

**genders** `string`

`all`、`male`、`female` のいずれか。

**interests** `array`

`GET /ads/tiktok/interests?search=<term>` から取得した興味関心カテゴリの ID。

**callToAction** `object`

`traffic` 目標では必須です。

**子属性**

**type** `string` *required*

`LEARN_MORE`、`SHOP_NOW`、`SIGN_UP`、`CONTACT_US`、`APPLY_NOW`、`BOOK_NOW`、`DOWNLOAD_NOW`、`GET_QUOTE`、`ORDER_NOW`、`SUBSCRIBE`、`WATCH_NOW`、`READ_MORE` のいずれか。

**link** `string`

開くページ。`traffic` 目標では必須です。

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

`active` または `paused`。

**idempotencyKey** `string`

このブーストリクエストに固有の、空でないキー。重複した広告の作成を避けるには、同じペイロードを同じキーで再試行してください。最初の応答 (エラーを含む) が再送されます。異なるペイロードでキーを再利用すると HTTP 409 が返されます。キーはこのプラットフォームにのみ適用されます。別のプラットフォームで同じキーを使うと、別のブーストが開始されます。処理中のリクエストでも 409 が返されます。予約を利用できない場合は、広告を作成せずに 503 が返されます。

**platformOptions.tiktok** `object`

**子属性**

**sparkAuthCode** `string`

動画の作成者が TikTok アプリでこの動画用に生成した Spark Ads コード。リンク済みの TikTok アカウント以外の動画では必須です。

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

`true` にすると、動画は作成者のプロフィールには表示されず、広告としてのみ表示されます。

```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.