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

# 更新廣告

> 暫停、恢復或刪除透過 Ayrshare 推廣的 Snapchat 廣告，包括廣告活動何時一併恢復，以及變更失敗後如何檢查廣告。

暫停、恢復或刪除你透過[推廣貼文](https://www.ayrshare.com/docs/apis/ads/snapchat/boost-post.md)建立的 Snapchat 廣告。

<ul>
  <li>`paused` 會停止廣告及其花費。`deleted` 會在 Snapchat 中刪除廣告。</li>
  <li>`active` 會恢復廣告。如果廣告所在的廣告活動已暫停且僅包含此廣告，該廣告活動也會恢復。</li>
  <li>廣告只有在其 ad squad 和廣告活動都處於啟用狀態時才會投放。如果 ad squad 已在 Snapchat 中暫停，或廣告活動已暫停且包含其他廣告，`active` 會回傳 `code: 369`。請先在 Snapchat Ads Manager 中恢復它們。</li>
  <li>Snapchat 沒有封存狀態，因此 `archived` 會回傳 `code: 101`。</li>
  <li>Ayrshare 沒有記錄的廣告可以暫停或刪除，但不能設定為 `active`。該請求會回傳 `code: 400`。請提供廣告 ID 聯絡支援團隊。</li>
  <li>如果 `active` 失敗且 Snapchat 無法確認廣告已再次停止，錯誤中會帶有 `warning`：廣告可能正在投放並產生花費。請在 Snapchat Ads Manager 中檢查，或再次傳送 `paused`。</li>
  <li>失敗的 `paused` 或 `deleted` 不帶 `warning`，但廣告可能仍在投放。請在[已推廣廣告](https://www.ayrshare.com/docs/apis/ads/snapchat/get-boosted-ads.md)或 Snapchat Ads Manager 中檢查，並再次傳送變更。</li>
  <li>若要查看廣告的目前狀態，請使用[已推廣廣告](https://www.ayrshare.com/docs/apis/ads/snapchat/get-boosted-ads.md)。</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`

## 請求體參數

**adId** `string` *required*

Snapchat 廣告 ID，即[推廣貼文](https://www.ayrshare.com/docs/apis/ads/snapchat/boost-post.md)回傳的 `id`。

**status** `string` *required*

新狀態：`active`、`paused` 或 `deleted`。不區分大小寫。

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X PUT https://api.ayrshare.com/api/ads/snapchat/ads \
-d '{"adId": "c3a1e2d4-0000-4000-8000-0000000000ad", "status": "paused"}'
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "adId": "c3a1e2d4-0000-4000-8000-0000000000ad",
  "requestedStatus": "PAUSED"
}
```

```json 400: Archived 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": "Status ARCHIVED is not supported on snapchat. Supported: ACTIVE, PAUSED, DELETED."
}
```

```json 400: Ad squad paused theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 369,
  "message": "Unable to boost post. Please try again.",
  "details": "Snapchat ad squad e5f6a7b8-0000-4000-8000-0000000000sq is PAUSED. Resume the ad squad in Snapchat to run this ad."
}
```


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