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

# Cập nhật Quảng cáo

> Tạm dừng, tiếp tục, lưu trữ hoặc xóa một quảng cáo Reddit bạn đã boost qua Ayrshare.

Thay đổi trạng thái của một quảng cáo Reddit bạn đã tạo bằng [Boost Bài đăng](https://www.ayrshare.com/docs/apis/ads/reddit/boost-post.md). Quảng cáo và chiến dịch mà Ayrshare tạo cho nó thay đổi cùng nhau.

<ul>
  <li>`DELETED` lưu trữ quảng cáo trên Reddit, giống như `ARCHIVED`. Sau đó quảng cáo hiển thị `adStatus: "ARCHIVED"` trong [Quảng cáo đã Boost](https://www.ayrshare.com/docs/apis/ads/reddit/get-boosted-ads.md) khi phản hồi được lưu đệm của nó được làm mới (xem `nextUpdate`).</li>
  <li>Một quảng cáo do hồ sơ khác boost sẽ trả về `code: 400`. Một quảng cáo mà Ayrshare không có bản ghi vẫn có thể được tạm dừng, lưu trữ hoặc xóa; đặt nó thành `ACTIVE` sẽ trả về `code: 400`.</li>
  <li>Nếu chiến dịch của quảng cáo cũng chứa các quảng cáo được tạo bên ngoài Ayrshare, chỉ quảng cáo này thay đổi. Để đặt nó thành `ACTIVE`, chiến dịch phải đang hoạt động trong Reddit Ads, nếu không phản hồi là `code: 369`.</li>
  <li>Nếu thay đổi sang `ACTIVE` không thành công và Reddit không thể xác nhận quảng cáo đã dừng lại, lỗi sẽ kèm một `warning` rằng quảng cáo có thể đang chạy và chi tiêu, và quảng cáo hiển thị `adStatus: "ACTIVE"`. Hãy kiểm tra quảng cáo và tạm dừng nếu cần.</li>
  <li>Nếu bạn gửi yêu cầu nhanh hơn mức Reddit cho phép, phản hồi sẽ là `code: 364` với HTTP 429.</li>
</ul>

## Tham số Header

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

## Tham số Body

**adId** `string` *required*

ID quảng cáo Reddit, ví dụ `2707300000000000001`.

**status** `string` *required*

`ACTIVE`, `PAUSED`, `ARCHIVED` hoặc `DELETED`. Chữ hoa hay chữ thường đều được.

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