# Audiences API

> Manage subscriber lists used by campaigns and sign-up forms.

Base URL: `https://api.emailit.com/v2`. Authenticate with `Authorization: Bearer <API key>`.

## Create an audience — POST /audiences

> Create an audience, a list of subscribers you can send campaigns to and collect sign-ups for with forms or a hosted subscribe link.

# Create an audience

Creates an empty audience.

`POST /audiences`

Requires a `full` API key. Add people with [Add a subscriber](/docs/api-reference/audiences/subscribers/add/), or by passing the audience ID in `audiences` when you [create a contact](/docs/api-reference/contacts/create/). Fires an `audience.created` event. See [Audiences](/docs/audiences/).

## Body parameters

- `name` (string, required): The audience name, such as `Newsletter`. Must be unique in the workspace.

- `visibility` (string): `public` lists the audience on the [manage subscriptions page](/docs/audiences/manage-subscriptions/) for everyone; `private` only for people subscribed to it.

- `public_name` (string | null): The name subscribers see in emails and on recipient pages. Up to 120 characters. `null` shows `name`.

- `public_description` (string | null): One line shown on the manage subscriptions page. Up to 500 characters.

- `double_opt_in` (boolean | object): `true` or `false`, or an object with any of `enabled`, `redirect_url` (an `http(s)` URL people go to after confirming, or `null`) and `email`. `email` takes `from`, `from_name` (the sender name inboxes show), `reply_to`, `subject`, `design` (`default` or `custom`), `heading`, `body`, `button_label` and `footer`. Fields you leave out keep their stored value. Turning it on needs a `from` address on a verified sending domain. See [Double opt-in](/docs/audiences/double-opt-in/).

- `confirmation_email` (boolean | object): `true` or `false`, or an object with `enabled` and `email`, which takes the same fields as above plus `button_url`.

- `unengaged` (object): `exclude` (skip [unengaged subscribers](/docs/audiences/unengaged/) in campaigns) and `days` (30 to 1,825).

## Returns

Returns `201` with the new audience, including its settings as described in [Retrieve an audience](/docs/api-reference/audiences/get/):

- `object` (string): Always `audience`.

- `id` (string): The audience ID.

- `name` (string): The audience name.

- `token` (string): The token in the audience's [subscribe URL](/docs/audiences/subscribe-url/). Keep it secret.

- `visibility` (string): `public` or `private`.

- `created_at` (string): When the audience was created.

- `updated_at` (string): When the audience was last changed.

**Request** `POST /audiences`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const audience = await emailit.audiences.create({
  name: 'Newsletter',
});
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

audience = client.audiences.create({
  "name": "Newsletter"
})
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$audience = $emailit->audiences()->create([
  'name' => 'Newsletter',
]);
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

audience = client.audiences.create(name: "Newsletter")
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

audience, err := client.Audiences.Create(&emailit.CreateAudienceRequest{
  Name: "Newsletter",
})
```

**Rust**

```rust
use emailit::Emailit;
use emailit::types::CreateAudienceParams;

let emailit = Emailit::new("your_api_key");

let audience = emailit.audiences.create(
  CreateAudienceParams::new("Newsletter")
).await?;
```

**Java**

```java
import com.emailit.*;
import com.emailit.params.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject audience = emailit.audiences().create(
  AudienceCreateParams.builder()
    .setName("Newsletter")
    .build()
);
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var audience = emailit.Audiences.Create(new AudienceCreateOptions {
  Name = "Newsletter",
});
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$audience = Emailit::audiences()->create([
  'name' => 'Newsletter',
]);
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/audiences \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Newsletter"}'
```

**201**

```json
{
  "object": "audience",
  "id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  "name": "Newsletter",
  "token": "4KXUJdXRVlVgbkWQm4GHLy8BleP",
  "visibility": "private",
  "public_name": null,
  "public_description": null,
  "double_opt_in": {
    "enabled": false,
    "redirect_url": null,
    "email": {
      "from": null,
      "from_name": null,
      "reply_to": null,
      "subject": "Confirm your subscription to {{audience_name}}",
      "design": "default",
      "heading": "Please confirm your subscription",
      "body": "Hi {{first_name|\"there\"}},\n\nYou asked to join {{audience_name}}. Confirm your email address to start getting our emails.",
      "button_label": "Confirm subscription",
      "footer": "Button not working? Open this link: <a href=\"{{confirm_url}}\">{{confirm_url}}</a>\n\nIf you did not ask to subscribe, ignore this email. You will not be added unless you confirm.",
      "source": null
    }
  },
  "confirmation_email": {
    "enabled": false,
    "email": {
      "from": null,
      "from_name": null,
      "reply_to": null,
      "subject": "You're subscribed to {{audience_name}}",
      "design": "default",
      "heading": "You're subscribed",
      "body": "Hi {{first_name|\"there\"}},\n\nThanks for joining {{audience_name}}. You will hear from us soon.",
      "button_label": "",
      "button_url": "",
      "footer": "You are getting this email because you subscribed to {{audience_name}}. <a href=\"{{manage_subscriptions_url}}\">Manage subscriptions</a>",
      "source": null
    }
  },
  "unengaged": { "exclude": false, "days": 365 },
  "archived": false,
  "archived_at": null,
  "subscribers_count": 0,
  "created_at": "2026-10-01T10:02:44.613207Z",
  "updated_at": "2026-10-01T10:02:44.613207Z"
}
```

**409**

```json
{
  "error": "Audience with this name already exists",
  "existing": {
    "object": "audience",
    "id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
    "name": "Newsletter",
    "token": "4KXUJdXRVlVgbkWQm4GHLy8BleP",
    "subscribers_count": 0,
    "created_at": "2026-10-01T10:02:44.000000Z",
    "updated_at": "2026-10-01T10:02:44.000000Z"
  }
}
```

---
Source: https://emailit.com/docs/api-reference/audiences/create/

## Retrieve an audience — GET /audiences/{id}

> Retrieve an audience by ID or name with its settings, subscriber and unengaged counts, your plan's subscriber limit and the token for its subscribe URL.

# Retrieve an audience

Retrieves an audience with its settings, counts and public token.

`GET /audiences/{id}`

Requires a `full` API key.

## Path parameters

- `id` (string, required): The audience ID (`aud_…`) or its exact name, URL-encoded.

## Returns

Returns the audience object.

- `object` (string): Always `audience`.

- `id` (string): The audience ID.

- `name` (string): The audience name.

- `token` (string): The token in the audience's [subscribe URL](/docs/audiences/subscribe-url/). Keep it secret: anyone with it can add people to the audience.

- `visibility` (string): `public` or `private`. Public audiences are listed on the [manage subscriptions page](/docs/audiences/manage-subscriptions/) for everyone; private ones only for people subscribed to them.

- `public_name` (string | null): The name subscribers see, or `null` to show `name`.

- `public_description` (string | null): The description shown on the manage subscriptions page.

- `double_opt_in` (object): `enabled`, `redirect_url` (where people go after confirming, or `null`) and `email`, the [double opt-in email](/docs/audiences/double-opt-in/) with `from`, `from_name`, `reply_to`, `subject`, `design` (`default` or `custom`), `heading`, `body`, `button_label`, `footer` and `source` (the MJML of a custom design, or `null`; lists leave it out). Fields you never set hold the defaults.

- `confirmation_email` (object): `enabled` and `email`, the [confirmation email](/docs/audiences/double-opt-in/#send-a-confirmation-email), with the same fields as above plus `button_url`.

- `unengaged` (object): `exclude` (whether campaigns skip [unengaged subscribers](/docs/audiences/unengaged/)) and `days` (the window, 365 by default).

- `archived` (boolean): Whether the audience is archived. `archived_at` holds the time, or `null`.

- `subscribers_count` (integer): How many contacts are in the audience, including unsubscribed ones.

- `usage` (object): `used` (the same count), `limit` (the most subscribers an audience can have on your plan, or `null` for no limit) and `plan`. See [Limits](/docs/limits/).

- `unengaged_count` (integer): How many subscribed members count as unengaged right now.

- `pending_confirmations_count` (integer): How many double opt-in requests are waiting for a click, not counting expired ones.

- `created_at` (string): When the audience was created.

- `updated_at` (string): When the audience was last changed.

**Request** `GET /audiences/{id}`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const audience = await emailit.audiences.get('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2');
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

audience = client.audiences.get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2")
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$audience = $emailit->audiences()->get('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2');
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

audience = client.audiences.get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2")
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

audience, err := client.Audiences.Get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2")
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let audience = emailit.audiences.get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2").await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject audience = emailit.audiences().get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2");
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var audience = emailit.Audiences.Get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2");
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$audience = Emailit::audiences()->get('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2');
```

**cURL**

```bash
curl https://api.emailit.com/v2/audiences/aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2 \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "object": "audience",
  "id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  "name": "Newsletter",
  "visibility": "public",
  "public_name": "Monthly newsletter",
  "public_description": "Product news and tips, once a month.",
  "double_opt_in": {
    "enabled": true,
    "redirect_url": null,
    "email": {
      "from": "News <news@example.com>",
      "from_name": null,
      "reply_to": null,
      "subject": "Confirm your subscription to {{audience_name}}",
      "design": "default",
      "heading": "Please confirm your subscription",
      "body": "Hi {{first_name|\"there\"}},\n\nYou asked to join {{audience_name}}. Confirm your email address to start getting our emails.",
      "button_label": "Confirm subscription",
      "footer": "Button not working? Open this link: <a href=\"{{confirm_url}}\">{{confirm_url}}</a>\n\nIf you did not ask to subscribe, ignore this email. You will not be added unless you confirm.",
      "source": null
    }
  },
  "confirmation_email": {
    "enabled": false,
    "email": {
      "from": null,
      "from_name": null,
      "reply_to": null,
      "subject": "You're subscribed to {{audience_name}}",
      "design": "default",
      "heading": "You're subscribed",
      "body": "Hi {{first_name|\"there\"}},\n\nThanks for joining {{audience_name}}. You will hear from us soon.",
      "button_label": "",
      "footer": "You are getting this email because you subscribed to {{audience_name}}. <a href=\"{{manage_subscriptions_url}}\">Manage subscriptions</a>",
      "button_url": "",
      "source": null
    }
  },
  "unengaged": { "exclude": true, "days": 365 },
  "archived": false,
  "archived_at": null,
  "token": "4KXUJdXRVlVgbkWQm4GHLy8BleP",
  "subscribers_count": 1284,
  "unengaged_count": 212,
  "pending_confirmations_count": 3,
  "usage": {
    "used": 1284,
    "limit": 50000,
    "plan": "pro"
  },
  "created_at": "2026-10-01T10:02:44.000000Z",
  "updated_at": "2026-10-01T10:02:44.000000Z"
}
```

**404**

```json
{
  "error": "Audience not found"
}
```

---
Source: https://emailit.com/docs/api-reference/audiences/get/

## Update an audience — POST /audiences/{id}

> Rename an audience or change its settings: visibility and public name, double opt-in, the confirmation email, the unengaged filter and archiving.

# Update an audience

Renames an audience or changes its settings.

`POST /audiences/{id}`

Requires a `full` API key. Send only the fields you want to change. The ID, token and subscribers don't change. Fires an `audience.updated` event.

## Path parameters

- `id` (string, required): The audience ID or its current name.

## Body parameters

- `name` (string): The new name. Must be unique in the workspace.

- `visibility` (string): `public` lists the audience on the [manage subscriptions page](/docs/audiences/manage-subscriptions/) for everyone; `private` only for people subscribed to it.

- `public_name` (string | null): The name subscribers see in emails and on recipient pages. Up to 120 characters. `null` shows `name`.

- `public_description` (string | null): One line shown on the manage subscriptions page. Up to 500 characters.

- `double_opt_in` (boolean | object): `true` or `false`, or an object with any of `enabled`, `redirect_url` (an `http(s)` URL people go to after confirming, or `null`) and `email`. `email` takes `from`, `from_name` (the sender name inboxes show), `reply_to`, `subject`, `design` (`default` or `custom`), `heading`, `body`, `button_label` and `footer`. Fields you leave out keep their stored value. Turning it on needs a `from` address on a verified sending domain. See [Double opt-in](/docs/audiences/double-opt-in/).

- `confirmation_email` (boolean | object): `true` or `false`, or an object with `enabled` and `email`, which takes the same fields as above plus `button_url`.

- `unengaged` (object): `exclude` (skip [unengaged subscribers](/docs/audiences/unengaged/) in campaigns) and `days` (30 to 1,825).

- `archived` (boolean): `true` archives the audience, `false` unarchives it. See [Archive an audience](/docs/audiences/#archive-an-audience).

Setting a custom MJML design with `email.source` is part of the [MJML alpha](/docs/templates/mjml/) and returns `403` with `error: "mjml_alpha"` for API keys.

## Returns

Returns the audience with its settings, as in [Retrieve an audience](/docs/api-reference/audiences/get/). In this response `subscribers_count` is always `0`, and the counts are left out; use Retrieve an audience for them. Invalid settings return `422` with an `errors` object keyed by field, such as `double_opt_in.email.from`.

**Request** `POST /audiences/{id}`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const audience = await emailit.audiences.update('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', {
  name: 'Weekly newsletter',
});
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

audience = client.audiences.update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", {
  "name": "Weekly newsletter"
})
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$audience = $emailit->audiences()->update('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', [
  'name' => 'Weekly newsletter',
]);
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

audience = client.audiences.update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", name: "Weekly newsletter")
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

audience, err := client.Audiences.Update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", &emailit.UpdateAudienceRequest{
  Name: "Weekly newsletter",
})
```

**Rust**

```rust
use emailit::Emailit;
use emailit::types::UpdateAudienceParams;

let emailit = Emailit::new("your_api_key");

let audience = emailit.audiences.update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", UpdateAudienceParams {
  name: Some("Weekly newsletter".into()),
  ..Default::default()
}).await?;
```

**Java**

```java
import com.emailit.*;
import com.emailit.params.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject audience = emailit.audiences().update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  AudienceUpdateParams.builder()
    .setName("Weekly newsletter")
    .build()
);
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var audience = emailit.Audiences.Update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", new AudienceUpdateOptions {
  Name = "Weekly newsletter",
});
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$audience = Emailit::audiences()->update('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', [
  'name' => 'Weekly newsletter',
]);
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/audiences/aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2 \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Weekly newsletter"}'
```

**200**

```json
{
  "object": "audience",
  "id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  "name": "Weekly newsletter",
  "token": "4KXUJdXRVlVgbkWQm4GHLy8BleP",
  "visibility": "public",
  "public_name": "Weekly newsletter",
  "public_description": null,
  "double_opt_in": {
    "enabled": true,
    "redirect_url": null,
    "email": {
      "from": "News <news@example.com>",
      "from_name": null,
      "reply_to": null,
      "subject": "Confirm your subscription to {{audience_name}}",
      "design": "default",
      "heading": "Please confirm your subscription",
      "body": "Hi {{first_name|\"there\"}},\n\nYou asked to join {{audience_name}}. Confirm your email address to start getting our emails.",
      "button_label": "Confirm subscription",
      "footer": "Button not working? Open this link: <a href=\"{{confirm_url}}\">{{confirm_url}}</a>\n\nIf you did not ask to subscribe, ignore this email. You will not be added unless you confirm.",
      "source": null
    }
  },
  "confirmation_email": {
    "enabled": false,
    "email": {
      "from": null,
      "from_name": null,
      "reply_to": null,
      "subject": "You're subscribed to {{audience_name}}",
      "design": "default",
      "heading": "You're subscribed",
      "body": "Hi {{first_name|\"there\"}},\n\nThanks for joining {{audience_name}}. You will hear from us soon.",
      "button_label": "",
      "button_url": "",
      "footer": "You are getting this email because you subscribed to {{audience_name}}. <a href=\"{{manage_subscriptions_url}}\">Manage subscriptions</a>",
      "source": null
    }
  },
  "unengaged": {
    "exclude": false,
    "days": 365
  },
  "archived": false,
  "archived_at": null,
  "subscribers_count": 0,
  "created_at": "2026-10-01T10:02:44.000000Z",
  "updated_at": "2026-10-01T14:31:09.000000Z"
}
```

**400**

```json
{
  "error": "No valid fields provided for update. Provide at least one of: name, visibility, public_name, public_description, double_opt_in, confirmation_email, unengaged, archived"
}
```

**422**

```json
{
  "message": "Validation failed.",
  "errors": {
    "double_opt_in.email.from": ["Use an address on a verified sending domain of this workspace."]
  }
}
```

**404**

```json
{
  "error": "Audience not found"
}
```

**409**

```json
{
  "error": "Another audience with this name already exists"
}
```

---
Source: https://emailit.com/docs/api-reference/audiences/update/

## List audiences — GET /audiences

> List the audiences of a workspace with their settings, subscriber counts and plan limits, newest first, with search, filters, sorting and archived audiences on request.

# List audiences

Returns a page of audiences, newest first. Archived audiences are left out unless you ask for them.

`GET /audiences`

Requires a `full` API key. List items don't include the audience `token`; use [Retrieve an audience](/docs/api-reference/audiences/get/) for it.

## Query parameters

- `page` (integer): The page to return.

- `limit` (integer): Audiences per page, from 1 to 100.

- `search` (string): Case-insensitive match on the audience name.

- `archived` (string): `false` for active audiences, `true` for archived ones only, `all` for both.

- `visibility` (string): `public` or `private` to list only those.

- `match` (string): `all` or `or`. How the filters below combine.

- `order` (string): `name`, `public_name`, `visibility`, `subscribers_count` or `created_at`.

- `direction` (string): `asc` or `desc`.

## Filters

Add filters as `key.condition=value`, for example `name.contains=news`. See [Filtering](/docs/api-reference/filtering/).

| Key | Type |
| --- | --- |
| `name` | string |
| `public_name` | string |
| `visibility` | enum: `public`, `private` |
| `subscribers_count` | number |
| `created_at` | date |

## Returns

- `data` (object[]): The audiences on this page, each with `object`, `id`, `name`, the settings (`visibility`, `public_name`, `public_description`, `double_opt_in`, `confirmation_email`, `unengaged`, `archived`, `archived_at`), `subscribers_count`, `usage`, `created_at` and `updated_at`. See [Retrieve an audience](/docs/api-reference/audiences/get/). The `email` objects in lists leave out `source`.

- `total_records` (integer): The number of audiences that match the search, filters and `archived`.

- `next_page_url` (string | null): Path of the next page, or `null`. See [Pagination](/docs/api-reference/pagination/).

- `previous_page_url` (string | null): Path of the previous page, or `null`.

**Request** `GET /audiences`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

const audiences = await emailit.audiences.list();
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

audiences = client.audiences.list()
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$audiences = $emailit->audiences()->list();
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

audiences = client.audiences.list
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

audiences, err := client.Audiences.List(nil)
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

let audiences = emailit.audiences.list(None).await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject audiences = emailit.audiences().list();
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var audiences = emailit.Audiences.List();
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

$audiences = Emailit::audiences()->list();
```

**cURL**

```bash
curl https://api.emailit.com/v2/audiences \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "data": [
    {
      "object": "audience",
      "id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
      "name": "Newsletter",
      "visibility": "public",
      "public_name": "Monthly newsletter",
      "public_description": "Product news and tips, once a month.",
      "double_opt_in": {
        "enabled": true,
        "redirect_url": null,
        "email": {
          "from": "News <news@example.com>",
          "from_name": null,
          "reply_to": null,
          "subject": "Confirm your subscription to {{audience_name}}",
          "design": "default",
          "heading": "Please confirm your subscription",
          "body": "Hi {{first_name|\"there\"}},\n\nYou asked to join {{audience_name}}. Confirm your email address to start getting our emails.",
          "button_label": "Confirm subscription",
          "footer": "Button not working? Open this link: <a href=\"{{confirm_url}}\">{{confirm_url}}</a>\n\nIf you did not ask to subscribe, ignore this email. You will not be added unless you confirm."
        }
      },
      "confirmation_email": {
        "enabled": false,
        "email": {
          "from": "News <news@example.com>",
          "from_name": null,
          "reply_to": null,
          "subject": "You're subscribed to {{audience_name}}",
          "design": "default",
          "heading": "You're subscribed",
          "body": "Hi {{first_name|\"there\"}},\n\nThanks for joining {{audience_name}}. You will hear from us soon.",
          "button_label": "",
          "footer": "You are getting this email because you subscribed to {{audience_name}}. <a href=\"{{manage_subscriptions_url}}\">Manage subscriptions</a>",
          "button_url": ""
        }
      },
      "unengaged": {
        "exclude": false,
        "days": 365
      },
      "archived": false,
      "archived_at": null,
      "subscribers_count": 1284,
      "usage": {
        "used": 1284,
        "limit": 50000,
        "plan": "pro"
      },
      "created_at": "2026-10-01T10:02:44.000000Z",
      "updated_at": "2026-10-01T10:02:44.000000Z"
    },
    {
      "object": "audience",
      "id": "aud_4KOlh9t2uw5od4qypqCtyrZyDq2",
      "name": "Customers",
      "visibility": "private",
      "public_name": null,
      "public_description": null,
      "double_opt_in": {
        "enabled": false,
        "redirect_url": null,
        "email": {
          "from": null,
          "from_name": null,
          "reply_to": null,
          "subject": "Confirm your subscription to {{audience_name}}",
          "design": "default",
          "heading": "Please confirm your subscription",
          "body": "Hi {{first_name|\"there\"}},\n\nYou asked to join {{audience_name}}. Confirm your email address to start getting our emails.",
          "button_label": "Confirm subscription",
          "footer": "Button not working? Open this link: <a href=\"{{confirm_url}}\">{{confirm_url}}</a>\n\nIf you did not ask to subscribe, ignore this email. You will not be added unless you confirm."
        }
      },
      "confirmation_email": {
        "enabled": false,
        "email": {
          "from": null,
          "from_name": null,
          "reply_to": null,
          "subject": "You're subscribed to {{audience_name}}",
          "design": "default",
          "heading": "You're subscribed",
          "body": "Hi {{first_name|\"there\"}},\n\nThanks for joining {{audience_name}}. You will hear from us soon.",
          "button_label": "",
          "footer": "You are getting this email because you subscribed to {{audience_name}}. <a href=\"{{manage_subscriptions_url}}\">Manage subscriptions</a>",
          "button_url": ""
        }
      },
      "unengaged": {
        "exclude": false,
        "days": 365
      },
      "archived": false,
      "archived_at": null,
      "subscribers_count": 312,
      "usage": {
        "used": 312,
        "limit": 50000,
        "plan": "pro"
      },
      "created_at": "2026-09-20T16:45:10.000000Z",
      "updated_at": "2026-09-20T16:45:10.000000Z"
    }
  ],
  "total_records": 2,
  "next_page_url": null,
  "previous_page_url": null
}
```

---
Source: https://emailit.com/docs/api-reference/audiences/list/

## Merge audiences — POST /audiences/{id}/merge

> Copy the subscribers of other audiences into an audience, keeping everyone's status, and optionally delete the merged audiences.

# Merge audiences

Copies the subscribers of other audiences into this one.

`POST /audiences/{id}/merge`

Requires a `full` API key. People who are already on the target audience keep their status there, so nobody who unsubscribed is subscribed again. A person on several of the merged audiences joins with **Subscribed** on when at least one of them has them subscribed. With `delete_sources`, the merged audiences are deleted afterwards and campaigns that haven't finished sending (drafts, scheduled, queued and sending campaigns, and A/B tests waiting for their winner) send to the target instead. If such a campaign included one merged audience and excluded another, the target stays included. [Segments](/docs/segments/) that draw from or have a rule on a deleted audience use the target instead, and so do automation triggers, steps, conditions and exit conditions that name it. So do forms that add people to it or offer it as a choice, double opt-in links that haven't been confirmed yet, and automation runs waiting on a condition about it. Each deletion fires `audience.deleted`.

Merging doesn't fire `subscriber.*` events, start automations or send double opt-in or confirmation emails. If the new subscribers would take the target over your plan's [subscriber limit](/docs/audiences/#limits), nothing is merged and the request returns `422` with your `usage`. Invalid input, such as merging an audience into itself, also returns `422`. See [Merge audiences](/docs/audiences/#merge-audiences).

## Path parameters

- `id` (string, required): The audience to merge into, by ID or name.

## Body parameters

- `source_ids` (string[], required): IDs of the audiences to merge, 1 to 50. Can't include the target.

- `delete_sources` (boolean): Delete the merged audiences after copying their subscribers.

## Returns

- `object` (string): Always `audience_merge`.

- `audience` (object): The target audience: `object`, `id`, `name` and its new `subscribers_count`.

- `added` (integer): How many people joined the target.

- `already_in_audience` (integer): How many people from the merged audiences were already on the target and kept their status.

- `deleted_source_ids` (string[]): The audiences that were deleted, or an empty array.

**Request** `POST /audiences/{id}/merge`

**Node.js**

```javascript
const response = await fetch('https://api.emailit.com/v2/audiences/aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2/merge', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    source_ids: ['aud_4KOlh9t2uw5od4qypqCtyrZyDq2'],
    delete_sources: true
  })
});

const { added, already_in_audience } = await response.json();
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/audiences/aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2/merge \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"source_ids": ["aud_4KOlh9t2uw5od4qypqCtyrZyDq2"], "delete_sources": true}'
```

**200**

```json
{
  "object": "audience_merge",
  "audience": {
    "object": "audience",
    "id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
    "name": "Newsletter",
    "subscribers_count": 1503
  },
  "added": 219,
  "already_in_audience": 93,
  "deleted_source_ids": ["aud_4KOlh9t2uw5od4qypqCtyrZyDq2"]
}
```

**404**

```json
{
  "error": "One or more audiences were not found",
  "missing": ["aud_4KOlh9t2uw5od4qypqCtyrZyDq2"]
}
```

**422**

```json
{
  "message": "Validation failed.",
  "errors": {
    "source_ids": ["An audience cannot be merged into itself."]
  }
}
```

---
Source: https://emailit.com/docs/api-reference/audiences/merge/

## Bulk update audiences — POST /audiences/bulk

> Archive, unarchive or delete up to 100 audiences in one request.

# Bulk update audiences

Archives, unarchives or deletes several audiences at once.

`POST /audiences/bulk`

Requires a `full` API key. Every ID must belong to the workspace, or nothing changes and the request returns `404` with the `missing` IDs. Archiving and unarchiving fire `audience.updated`; deleting fires `audience.deleted` and removes the audiences' subscribers, like [Delete an audience](/docs/api-reference/audiences/delete/). See [Archive an audience](/docs/audiences/#archive-an-audience).

## Body parameters

- `action` (string, required): `archive`, `unarchive` or `delete`.

- `ids` (string[], required): Audience IDs, 1 to 100.

## Returns

- `object` (string): Always `audience_bulk`.

- `action` (string): The action you sent.

- `processed` (integer): How many audiences were found.

- `changed` (integer): How many actually changed. Archiving an audience that's already archived doesn't count.

- `ids` (string[]): The IDs you sent.

**Request** `POST /audiences/bulk`

**Node.js**

```javascript
const response = await fetch('https://api.emailit.com/v2/audiences/bulk', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    action: 'archive',
    ids: ['aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'aud_4KOlh9t2uw5od4qypqCtyrZyDq2']
  })
});

const { changed } = await response.json();
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/audiences/bulk \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"action": "archive", "ids": ["aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "aud_4KOlh9t2uw5od4qypqCtyrZyDq2"]}'
```

**200**

```json
{
  "object": "audience_bulk",
  "action": "archive",
  "processed": 2,
  "changed": 2,
  "ids": ["aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "aud_4KOlh9t2uw5od4qypqCtyrZyDq2"]
}
```

**404**

```json
{
  "error": "One or more audiences were not found",
  "missing": ["aud_4KOlh9t2uw5od4qypqCtyrZyDq2"]
}
```

---
Source: https://emailit.com/docs/api-reference/audiences/bulk/

## Delete an audience — DELETE /audiences/{id}

> Permanently delete an audience and all of its subscriber memberships. The contacts themselves stay in your workspace.

# Delete an audience

Permanently deletes an audience and removes everyone from it.

`DELETE /audiences/{id}`

Requires a `full` API key. The audience's subscriber memberships are deleted with it, but the [contacts](/docs/api-reference/contacts/) stay in your workspace and in their other audiences. Its hosted subscribe URL stops working. Fires an `audience.deleted` event. No `subscriber.deleted` events are sent for the removed memberships.

## Path parameters

- `id` (string, required): The audience ID or its name.

## Returns

- `object` (string): Always `audience`.

- `id` (string): The ID of the deleted audience.

- `name` (string): The audience name.

- `deleted` (boolean): Always `true`.

**Request** `DELETE /audiences/{id}`

**Node.js**

```javascript
import { Emailit } from '@emailit/node';
const emailit = new Emailit('your_api_key');

await emailit.audiences.delete('aud_4KOlh9t2uw5od4qypqCtyrZyDq2');
```

**Python**

```python
from emailit import EmailitClient
client = EmailitClient("your_api_key")

client.audiences.delete("aud_4KOlh9t2uw5od4qypqCtyrZyDq2")
```

**PHP**

```php
$emailit = Emailit::client('your_api_key');

$emailit->audiences()->delete('aud_4KOlh9t2uw5od4qypqCtyrZyDq2');
```

**Ruby**

```ruby
require "emailit"
client = Emailit::EmailitClient.new("your_api_key")

client.audiences.delete("aud_4KOlh9t2uw5od4qypqCtyrZyDq2")
```

**Go**

```go
import "github.com/emailit/emailit-go/v2"
client := emailit.NewClient("your_api_key")

err := client.Audiences.Delete("aud_4KOlh9t2uw5od4qypqCtyrZyDq2")
```

**Rust**

```rust
use emailit::Emailit;

let emailit = Emailit::new("your_api_key");

emailit.audiences.delete("aud_4KOlh9t2uw5od4qypqCtyrZyDq2").await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

emailit.audiences().delete("aud_4KOlh9t2uw5od4qypqCtyrZyDq2");
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

emailit.Audiences.Delete("aud_4KOlh9t2uw5od4qypqCtyrZyDq2");
```

**Laravel**

```php
use Emailit\Laravel\Facades\Emailit;

Emailit::audiences()->delete('aud_4KOlh9t2uw5od4qypqCtyrZyDq2');
```

**cURL**

```bash
curl -X DELETE https://api.emailit.com/v2/audiences/aud_4KOlh9t2uw5od4qypqCtyrZyDq2 \
  -H "Authorization: Bearer $EMAILIT_API_KEY"
```

**200**

```json
{
  "object": "audience",
  "id": "aud_4KOlh9t2uw5od4qypqCtyrZyDq2",
  "name": "Customers",
  "deleted": true
}
```

**404**

```json
{
  "error": "Audience not found"
}
```

---
Source: https://emailit.com/docs/api-reference/audiences/delete/
