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