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

# Аудиторії

> Список сегментів аудиторій рекламного акаунта Snapchat із типом, розміром і тим, чи може просування вже на них таргетуватися.

Список сегментів аудиторій рекламного акаунта Snapchat: ваші списки клієнтів, відвідувачі сайту, яких зафіксував ваш Snap Pixel, і lookalike. Використовуйте ID у `targeting.audiences` або `targeting.excludedAudiences`, коли [просуваєте Snap](https://www.ayrshare.com/docs/apis/ads/snapchat/boost-post.md#audiences).

<ul>
  <li>Сегменти, створені в Snapchat Ads Manager, теж потрапляють у список, а не лише створені через Ayrshare.</li>
  <li>`status.ready` стає `true`, щойно Snapchat повідомляє, що просування може таргетуватися на сегмент. Сегмент із замалою кількістю зіставлених людей не готовий (`TOO_FEW_USERS`).</li>
  <li>`size` містить власну кількість зіставлених людей від Snapchat, надіслану і як `lower`, і як `upper`.</li>
  <li>Результати не кешуються: розмір і готовність сегмента змінюються, поки він наповнюється.</li>
  <li>Snapchat сам задає розмір сторінки, тому `limit` тут не діє.</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`

## Параметри запиту

**accountId** `string` *required*

ID вашого рекламного акаунта Snapchat, сегменти якого потрібно отримати, наприклад `5a0d0000-0000-4000-8000-000000000003`.

**next** `string`

Коли відповідь містить `meta.pagination.hasMore: true`, надішліть сюди її значення `meta.pagination.next`, щоб отримати наступну сторінку. Інші параметри надсилайте без змін: значення `next` з іншого запиту повертає `code: 101`.

## Відповідь

Кожна аудиторія містить:

<ul>
  <li>`id`: ID сегмента для просування, додавання людей або видалення.</li>
  <li>`name`: назва, яка відображається в Ads Manager.</li>
  <li>`type`: `customerList`, `website`, `lookalike` або `other` для типу сегмента, який Ayrshare не створює.</li>
  <li>`size`: `{ lower, upper }`, обидва з кількістю від Snapchat, або `null`, коли Snapchat нічого не повідомляє.</li>
  <li>`status`: `{ ready, code, description }`. `ready` має значення `true`, коли просування вже може таргетуватися на сегмент. `code` завжди `null`. `description` містить статус Snapchat: `READY`, `NOT_READY` або `TOO_FEW_USERS`.</li>
  <li>`created`: коли сегмент створено, у форматі ISO 8601, або `null`.</li>
</ul>

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/snapchat/audiences?accountId=5a0d1b2c-0000-4000-8000-000000000003"
```

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

fetch("https://api.ayrshare.com/api/ads/snapchat/audiences?accountId=5a0d1b2c-0000-4000-8000-000000000003", {
      method: "GET",
      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.get('https://api.ayrshare.com/api/ads/snapchat/audiences?accountId=5a0d1b2c-0000-4000-8000-000000000003', headers=headers)

print(r.json())
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "audiences": [
    {
      "id": "8c1e2f3a-0000-4000-8000-000000000101",
      "name": "Newsletter subscribers",
      "type": "customerList",
      "size": { "lower": 12000, "upper": 12000 },
      "status": { "ready": true, "code": null, "description": "READY" },
      "created": "2026-11-20T09:12:00.000Z"
    },
    {
      "id": "8c1e2f3a-0000-4000-8000-000000000102",
      "name": "Like my subscribers",
      "type": "lookalike",
      "size": { "lower": 0, "upper": 0 },
      "status": { "ready": false, "code": null, "description": "NOT_READY" },
      "created": "2026-12-01T16:40:00.000Z"
    }
  ],
  "meta": { "pagination": { "hasMore": false } }
}
```

```json 400: Missing 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": "accountId is required."
}
```

```json 400: Snapchat refused the request theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 370,
  "message": "Error getting audiences. Please try again.",
  "details": "Snapchat's reason"
}
```


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