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

# Create Audience

> Create a Reddit custom audience of your own customer list or your website visitors, to include or exclude when boosting a post.

Create a custom audience on a Reddit ad account. Two kinds are supported, chosen by `type`:

<ul>
  <li>`customerList`: your own list of people, which you fill with hashed identifiers through [Audience Members](https://www.ayrshare.com/docs/apis/ads/reddit/audience-members.md).</li>
  <li>`website`: people your Reddit pixel saw on your site.</li>
</ul>

The new audience is returned under `audience` in the same shape as [Audiences](https://www.ayrshare.com/docs/apis/ads/reddit/get-audiences.md), with `status.ready: false`. Reddit fills it over time. List it to see when `status.ready` turns `true`, then use its `id` in `targeting.audiences` or `targeting.excludedAudiences` when you [boost a post](https://www.ayrshare.com/docs/apis/ads/reddit/boost-post.md#audiences).

<ul>
  <li>Reddit cannot create engagement or lookalike audiences here. Sending `type: engagement` or `type: lookalike` returns a `400` with `code: 101`.</li>
  <li>An audience needs at least 1,000 matched people before a boost can target it.</li>
</ul>

## Header Parameters

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

## Body Parameters

Both types take these:

**accountId** `string` *required*

Your Reddit ad account ID, for example `a2_abc123`.

**name** `string` *required*

The name shown in Reddit Ads Manager.

**type** `string` *required*

`customerList` or `website`. Each type takes only its own fields below. A field from another type returns a `400` with `code: 101` naming it.

**idempotencyKey** `string`

A new unique value, such as a UUID, for each new audience. If you repeat a request with the same key, Ayrshare returns the first response, marked `idempotentReplayed: true`, and creates no second audience. You can send the key as the `Idempotency-Key` header instead; if you send both, they must match. Reusing a key with a different request, or while the first request is still in progress, returns a `409`. A `503` means the key could not be reserved and nothing was created: retry later with the same key.

### Customer-list audiences

A customer list takes no other required fields and starts empty. Add people with [Audience Members](https://www.ayrshare.com/docs/apis/ads/reddit/audience-members.md). Hashed identifiers are still personal data: read that page before you upload a list.

`customerFileSource` is not accepted on Reddit unless it is `USER_PROVIDED_ONLY`: Reddit takes your own lists only.

### Website audiences

**pixelId** `string` *required*

Your Reddit pixel ID, from Reddit Ads Events Manager.

**retentionDays** `number` *required*

How many days a visitor stays in the audience after their last visit, 1 to 90.

**event** `string`

Keep only visitors who fired this event. Reddit's standard events are `PAGE_VISIT`, `VIEW_CONTENT`, `SEARCH`, `ADD_TO_CART`, `ADD_TO_WISHLIST`, `PURCHASE`, `LEAD` and `SIGN_UP`, in any letter case. Any other value is sent as a custom event name. Leave it out to count every visit.

`urlContains` is not accepted on Reddit: Reddit has no URL filter on a website audience.

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.ayrshare.com/api/ads/reddit/audiences \
-d '{"accountId": "a2_abcdefg", "name": "Site visitors 30d", "type": "website", "pixelId": "t2_pixel123", "retentionDays": 30, "event": "purchase"}'
```

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

fetch("https://api.ayrshare.com/api/ads/reddit/audiences", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${API_KEY}`,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
    "accountId": "a2_abcdefg",
    "name": "Site visitors 30d",
    "type": "website",
    "pixelId": "t2_pixel123",
    "retentionDays": 30,
    "event": "purchase"
  })
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

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

headers = {'Authorization': 'Bearer API_KEY', 'Content-Type': 'application/json'}
payload = {
  "accountId": "a2_abcdefg",
  "name": "Site visitors 30d",
  "type": "website",
  "pixelId": "t2_pixel123",
  "retentionDays": 30,
  "event": "purchase"
}

r = requests.post('https://api.ayrshare.com/api/ads/reddit/audiences', json=payload, headers=headers)

print(r.json())
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "audience": {
    "id": "ca.129482487242999",
    "name": "Site visitors 30d",
    "type": "website",
    "size": null,
    "status": { "ready": false, "code": null, "description": "PENDING" },
    "created": "2026-12-02T10:05:00.000Z"
  }
}
```

```json 400: Lookback over 90 days 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": "retentionDays on reddit is at most 90."
}
```

```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"
}
```

```json 400: Reddit failed the request theme={"system"}
{
  "action": "ads",
  "status": "error",
  "code": 369,
  "message": "Unable to create the audience. Please try again.",
  "details": "Reddit's reason"
}
```


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