> ## 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 повертає `400` з `code: 101`.</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.