> ## 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>由其他個人檔案推廣的廣告會返回 `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.