> ## 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 推广的 Reddit 广告。

更改您通过[推广帖子](https://www.ayrshare.com/docs/apis/ads/reddit/boost-post.md)创建的 Reddit 广告的状态。该广告与 Ayrshare 为其创建的活动会一同更改。

<ul>
  <li>`DELETED` 会在 Reddit 上归档该广告，与 `ARCHIVED` 相同。缓存结果刷新后（请参阅 `nextUpdate`），该广告在[已推广广告](https://www.ayrshare.com/docs/apis/ads/reddit/get-boosted-ads.md)中会显示为 `adStatus: "ARCHIVED"`。</li>
  <li>由其他 Profile推广的广告会返回 `code: 400`。Ayrshare 没有记录的广告可以暂停、归档或删除；将其设为 `ACTIVE` 会返回 `code: 400`。</li>
  <li>如果该广告所在的活动中还有在 Ayrshare 之外创建的广告，则只有此广告会更改。要将其设为 `ACTIVE`，该活动必须在 Reddit Ads 中处于活跃状态，否则会返回 `code: 369`。</li>
  <li>如果更改为 `ACTIVE` 失败，且 Reddit 无法确认广告已重新停止，错误中会包含 `warning`，提示该广告可能正在投放并产生花费，广告会显示 `adStatus: "ACTIVE"`。请检查该广告，必要时将其暂停。</li>
  <li>如果您发送请求的速度超过 Reddit 允许的频率，将返回 `code: 364` 及 HTTP 429。</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*

Reddit 广告 ID，例如 `2707300000000000001`。

**status** `string` *required*

`ACTIVE`、`PAUSED`、`ARCHIVED` 或 `DELETED`。大小写均可。

```bash cURL theme={"system"}
curl -X PUT https://api.ayrshare.com/api/ads/reddit/ads \
  -H "Authorization: Bearer API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "adId": "2707300000000000001",
    "status": "PAUSED"
  }'
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "adId": "2707300000000000001",
  "requestedStatus": "PAUSED"
}
```

```json 400: Invalid status 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": "Invalid status: STOPPED. Status must be one of ACTIVE, PAUSED, DELETED, ARCHIVED."
}
```

```json 400: Resume failed, ad may be live theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 369,
  "message": "Unable to boost post. Please try again.",
  "warning": "The status change failed, and reddit did not confirm that ad 2707300000000000001 is stopped. It may be live and spending. Check it on reddit or pause it."
}
```


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