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

# 刪除受眾

> 依 ID 永久刪除 Reddit 廣告帳戶中的自訂受眾，包括在 Reddit Ads Manager 中建立的受眾。

從 Reddit 廣告帳戶中刪除自訂受眾。此操作是永久性的：受眾也會從 Reddit Ads Manager 中消失，任何鎖定它的投放中廣告都將不再觸及這些人。

<ul>
  <li>可以刪除 `accountId` 指定之廣告帳戶上的任何自訂受眾，包括在 Reddit Ads Manager 中建立的受眾。任何其他 ID 都會返回帶有 `code: 101` 的 `400`。</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`

## 路徑參數

**id** `string` *required*

受眾 ID，來自[受眾](https://www.ayrshare.com/docs/apis/ads/reddit/get-audiences.md)，例如 `ca.129482487242828`。

## 查詢參數

**accountId** `string` *required*

受眾所屬的 Reddit 廣告帳戶，例如 `a2_abc123`。

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X DELETE "https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828?accountId=a2_abcdefg"
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";

fetch("https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828?accountId=a2_abcdefg", {
      method: "DELETE",
      headers: {
        "Authorization": `Bearer ${API_KEY}`
      }
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

```python Python theme={"system"}
import requests

headers = {'Authorization': 'Bearer API_KEY'}

r = requests.delete('https://api.ayrshare.com/api/ads/reddit/audiences/ca.129482487242828?accountId=a2_abcdefg', headers=headers)

print(r.json())
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "id": "ca.129482487242828",
  "deleted": true
}
```

```json 400: Not an audience of this account 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": "id ca.129482487242828 is not a custom audience of ad account a2_abcdefg."
}
```

```json 400: Reddit refused the request 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": "Reddit's reason"
}
```


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