# Subscribers API

> Add, update and remove the subscribers of an audience.

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

## Add a subscriber — POST /audiences/{audience_id}/subscribers

> Add an email address to an audience. Emailit creates the contact if it doesn't exist and resubscribes it if it had unsubscribed.

# Add a subscriber

Adds a contact to an audience by email address.

`POST /audiences/{audience_id}/subscribers`

Requires a `full` API key. If no contact has this email yet, Emailit creates one. If the contact exists, the names and custom fields you send overwrite its current values. A contact that had unsubscribed from the audience is subscribed again and the response is `200`; a contact that's already subscribed returns `409`.

Each audience can hold as many subscribers as your plan allows; past that, the request returns `422` with your `usage`. Fires `subscriber.created`, or `subscriber.updated` and `subscriber.resubscribed` for a resubscribe.

## Path parameters

- `audience_id` (string, required): The audience ID (`aud_…`) or its name.

## Body parameters

- `email` (string, required): The email address to subscribe. Stored in lowercase.

- `first_name` (string): The contact's first name.

- `last_name` (string): The contact's last name.

- `custom_fields` (object): [Custom field](/docs/contacts/custom-fields/) values by key, such as `{"company": "Analytical Engines"}`. Replaces the contact's existing custom fields.

## Returns

Returns `201` with the [subscriber object](/docs/api-reference/audiences/subscribers/get/), or `200` when an unsubscribed contact was subscribed again.

**Request** `POST /audiences/{audience_id}/subscribers`

**Node.js**

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

const subscriber = await emailit.subscribers.create('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', {
  email: 'ada@example.com',
  first_name: 'Ada',
  last_name: 'Lovelace',
});
```

**Python**

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

subscriber = client.subscribers.create("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", {
  "email": "ada@example.com",
  "first_name": "Ada",
  "last_name": "Lovelace",
})
```

**PHP**

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

$subscriber = $emailit->subscribers()->create('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', [
  'email' => 'ada@example.com',
  'first_name' => 'Ada',
  'last_name' => 'Lovelace',
]);
```

**Ruby**

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

subscriber = client.subscribers.create("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  email: "ada@example.com",
  first_name: "Ada",
  last_name: "Lovelace"
)
```

**Go**

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

subscriber, err := client.Subscribers.Create("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", &emailit.CreateSubscriberRequest{
  Email:     "ada@example.com",
  FirstName: "Ada",
  LastName:  "Lovelace",
})
```

**Rust**

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

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

let subscriber = emailit.subscribers.create("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  CreateSubscriberParams::new("ada@example.com")
    .with_first_name("Ada")
    .with_last_name("Lovelace")
).await?;
```

**Java**

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

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject subscriber = emailit.subscribers().create("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  SubscriberCreateParams.builder()
    .setEmail("ada@example.com")
    .setFirstName("Ada")
    .setLastName("Lovelace")
    .build()
);
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var subscriber = emailit.Subscribers.Create("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", new SubscriberCreateOptions {
  Email = "ada@example.com",
  FirstName = "Ada",
  LastName = "Lovelace",
});
```

**Laravel**

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

$subscriber = Emailit::subscribers()->create('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', [
  'email' => 'ada@example.com',
  'first_name' => 'Ada',
  'last_name' => 'Lovelace',
]);
```

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/audiences/aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2/subscribers \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@example.com",
    "first_name": "Ada",
    "last_name": "Lovelace",
    "custom_fields": { "company": "Analytical Engines" }
  }'
```

**201**

```json
{
  "object": "subscriber",
  "id": "sub_4KECYl5AwXEy8ezswYRhuddttxo",
  "audience_id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  "contact_id": "con_4K9kQdrXth7am0TPKvPrR5yd2oo",
  "email": "ada@example.com",
  "first_name": "Ada",
  "last_name": "Lovelace",
  "custom_fields": {
    "company": "Analytical Engines"
  },
  "subscribed": true,
  "subscribed_at": "2026-10-01T10:20:31.000000Z",
  "unsubscribed_at": null,
  "created_at": "2026-10-01T10:20:31.000000Z",
  "updated_at": "2026-10-01T10:20:31.000000Z"
}
```

**404**

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

**409**

```json
{
  "error": "Contact is already subscribed to this audience",
  "existing": {
    "object": "subscriber",
    "id": "sub_4KECYl5AwXEy8ezswYRhuddttxo",
    "audience_id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
    "contact_id": "con_4K9kQdrXth7am0TPKvPrR5yd2oo",
    "email": "ada@example.com",
    "first_name": "Ada",
    "last_name": "Lovelace",
    "custom_fields": { "company": "Analytical Engines" },
    "subscribed": true,
    "subscribed_at": "2026-10-01T10:20:31.000Z",
    "unsubscribed_at": null,
    "created_at": "2026-10-01T10:20:31.000Z",
    "updated_at": "2026-10-01T10:20:31.000Z"
  }
}
```

**422**

```json
{
  "error": "Pro includes 50,000 subscribers per audience.",
  "usage": {
    "used": 50000,
    "limit": 50000,
    "plan": "pro"
  }
}
```

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

## Retrieve a subscriber — GET /audiences/{audience_id}/subscribers/{id}

> Retrieve one subscriber of an audience by subscriber ID or email address, with the contact's details and subscription status.

# Retrieve a subscriber

Retrieves a contact's membership in an audience.

`GET /audiences/{audience_id}/subscribers/{id}`

Requires a `full` API key. A subscriber links one [contact](/docs/api-reference/contacts/) to one audience. The email, names and custom fields belong to the contact, and `subscribed` belongs to this audience only.

## Path parameters

- `audience_id` (string, required): The audience ID (`aud_…`) or its name.

- `id` (string, required): The subscriber ID (`sub_…`) or the contact's email address, URL-encoded.

## Returns

Returns the subscriber object.

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

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

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

- `contact_id` (string): The ID of the contact.

- `email` (string): The contact's email address.

- `first_name` (string | null): The contact's first name.

- `last_name` (string | null): The contact's last name.

- `custom_fields` (object | null): The contact's custom field values.

- `subscribed` (boolean): `true` if the contact is subscribed to this audience, `false` if they unsubscribed.

- `subscribed_at` (string | null): When the contact last subscribed.

- `unsubscribed_at` (string | null): When the contact unsubscribed, or `null`.

- `created_at` (string): When the contact joined the audience.

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

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

**Node.js**

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

const subscriber = await emailit.subscribers.get('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'sub_4KECYl5AwXEy8ezswYRhuddttxo');
```

**Python**

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

subscriber = client.subscribers.get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo")
```

**PHP**

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

$subscriber = $emailit->subscribers()->get('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'sub_4KECYl5AwXEy8ezswYRhuddttxo');
```

**Ruby**

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

subscriber = client.subscribers.get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo")
```

**Go**

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

subscriber, err := client.Subscribers.Get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo")
```

**Rust**

```rust
use emailit::Emailit;

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

let subscriber = emailit.subscribers.get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo").await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject subscriber = emailit.subscribers().get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo");
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var subscriber = emailit.Subscribers.Get("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo");
```

**Laravel**

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

$subscriber = Emailit::subscribers()->get('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'sub_4KECYl5AwXEy8ezswYRhuddttxo');
```

**cURL**

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

**200**

```json
{
  "object": "subscriber",
  "id": "sub_4KECYl5AwXEy8ezswYRhuddttxo",
  "audience_id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  "contact_id": "con_4K9kQdrXth7am0TPKvPrR5yd2oo",
  "email": "ada@example.com",
  "first_name": "Ada",
  "last_name": "Lovelace",
  "custom_fields": {
    "company": "Analytical Engines"
  },
  "subscribed": true,
  "subscribed_at": "2026-10-01T10:20:31.000000Z",
  "unsubscribed_at": null,
  "created_at": "2026-10-01T10:20:31.000000Z",
  "updated_at": "2026-10-01T10:20:31.000000Z"
}
```

**404**

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

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

## Update a subscriber — POST /audiences/{audience_id}/subscribers/{id}

> Unsubscribe or resubscribe a contact in one audience, or change the contact's email address, names and custom fields.

# Update a subscriber

Changes a subscriber's status in the audience, or the details of its contact.

`POST /audiences/{audience_id}/subscribers/{id}`

Requires a `full` API key. Send only the fields you want to change. `subscribed` applies to this audience only. `email`, `first_name`, `last_name` and `custom_fields` change the contact itself, so the change shows up in every audience the contact belongs to. Fires a `subscriber.updated` event.

## Path parameters

- `audience_id` (string, required): The audience ID (`aud_…`) or its name.

- `id` (string, required): The subscriber ID (`sub_…`) or the contact's email address, URL-encoded.

## Body parameters

- `subscribed` (boolean): `false` to unsubscribe the contact from this audience, `true` to subscribe them again. The subscriber stays in the audience either way.

- `email` (string): A new email address for the contact. Stored in lowercase.

- `first_name` (string): The contact's first name.

- `last_name` (string): The contact's last name.

- `custom_fields` (object): Custom field values by key. Replaces the contact's existing custom fields.

## Returns

Returns the updated [subscriber object](/docs/api-reference/audiences/subscribers/get/). A request without any of these fields returns `400`.

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

**Node.js**

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

const subscriber = await emailit.subscribers.update('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'sub_4KECYl5AwXEy8ezswYRhuddttxo', {
  first_name: 'Augusta',
});
```

**Python**

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

subscriber = client.subscribers.update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo", {
  "first_name": "Augusta",
})
```

**PHP**

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

$subscriber = $emailit->subscribers()->update('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'sub_4KECYl5AwXEy8ezswYRhuddttxo', [
  'first_name' => 'Augusta',
]);
```

**Ruby**

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

subscriber = client.subscribers.update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo",
  first_name: "Augusta"
)
```

**Go**

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

subscriber, err := client.Subscribers.Update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo", &emailit.UpdateSubscriberRequest{
  FirstName: "Augusta",
})
```

**Rust**

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

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

let subscriber = emailit.subscribers.update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo", UpdateSubscriberParams {
  first_name: Some("Augusta".into()),
  ..Default::default()
}).await?;
```

**Java**

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

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject subscriber = emailit.subscribers().update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo",
  SubscriberUpdateParams.builder()
    .setFirstName("Augusta")
    .build()
);
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var subscriber = emailit.Subscribers.Update("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo", new SubscriberUpdateOptions {
  FirstName = "Augusta",
});
```

**Laravel**

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

$subscriber = Emailit::subscribers()->update('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'sub_4KECYl5AwXEy8ezswYRhuddttxo', [
  'first_name' => 'Augusta',
]);
```

**cURL**

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

**cURL**

```bash
curl -X POST https://api.emailit.com/v2/audiences/aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2/subscribers/ada%40example.com \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subscribed": false}'
```

**200**

```json
{
  "object": "subscriber",
  "id": "sub_4KECYl5AwXEy8ezswYRhuddttxo",
  "audience_id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  "contact_id": "con_4K9kQdrXth7am0TPKvPrR5yd2oo",
  "email": "ada@example.com",
  "first_name": "Ada",
  "last_name": "Lovelace",
  "custom_fields": {
    "company": "Analytical Engines"
  },
  "subscribed": false,
  "subscribed_at": "2026-10-01T10:20:31.000000Z",
  "unsubscribed_at": "2026-10-02T08:14:55.000000Z",
  "created_at": "2026-10-01T10:20:31.000000Z",
  "updated_at": "2026-10-02T08:14:55.000000Z"
}
```

**400**

```json
{
  "error": "No valid fields provided for update. Provide at least one of: email, first_name, last_name, custom_fields, subscribed"
}
```

**404**

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

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

## List subscribers — GET /audiences/{audience_id}/subscribers

> List the subscribers of an audience, newest first, with search, a subscribed filter, list filters and the audience's plan usage.

# List subscribers

Returns a page of an audience's subscribers, newest first.

`GET /audiences/{audience_id}/subscribers`

Requires a `full` API key. The list includes contacts who unsubscribed from the audience unless you filter them out with `subscribed=true`.

## Path parameters

- `audience_id` (string, required): The audience ID (`aud_…`) or its name.

## Query parameters

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

- `limit` (integer): Subscribers per page, from 1 to 100. `per_page` works too.

- `subscribed` (string): `true` for subscribed contacts only, `false` for unsubscribed ones only.

- `search` (string): Case-insensitive match on the email address, first name or last name.

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

- `order` (string): A filter key to sort by.

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

## Filters

Add filters as `key.condition=value`, for example `email.ends_with=@acme.com`. See [Filtering](/docs/api-reference/filtering/).

| Key | Type | Notes |
| --- | --- | --- |
| `email` | string | |
| `first_name` | string | |
| `last_name` | string | |
| `subscribed` | boolean | |
| `created_at` | date | When the contact joined the audience. |

Every key is also a sort key.

## Returns

- `data` (object[]): The [subscriber objects](/docs/api-reference/audiences/subscribers/get/) on this page.

- `next_page_url` (string | null): Path of the next page, or `null`. It keeps `subscribed` but not your other filters. See [Pagination](/docs/api-reference/pagination/).

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

- `usage` (object): `used` (subscribers in the audience), `limit` (the most your plan allows per audience, or `null`) and `plan`.

**Request** `GET /audiences/{audience_id}/subscribers`

**Node.js**

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

const subscribers = await emailit.subscribers.list('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2');
```

**Python**

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

subscribers = client.subscribers.list("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2")
```

**PHP**

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

$subscribers = $emailit->subscribers()->list('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2');
```

**Ruby**

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

subscribers = client.subscribers.list("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2")
```

**Go**

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

subscribers, err := client.Subscribers.List("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", nil)
```

**Rust**

```rust
use emailit::Emailit;

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

let subscribers = emailit.subscribers.list("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", None).await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

EmailitObject subscribers = emailit.subscribers().list("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2");
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

var subscribers = emailit.Subscribers.List("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2");
```

**Laravel**

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

$subscribers = Emailit::subscribers()->list('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2');
```

**cURL**

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

**cURL**

```bash
curl -G https://api.emailit.com/v2/audiences/aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2/subscribers \
  -H "Authorization: Bearer $EMAILIT_API_KEY" \
  -d subscribed=true \
  -d limit=100
```

**200**

```json
{
  "data": [
    {
      "object": "subscriber",
      "id": "sub_4KECYl5AwXEy8ezswYRhuddttxo",
      "audience_id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
      "contact_id": "con_4K9kQdrXth7am0TPKvPrR5yd2oo",
      "email": "ada@example.com",
      "first_name": "Ada",
      "last_name": "Lovelace",
      "custom_fields": {
        "company": "Analytical Engines"
      },
      "subscribed": true,
      "subscribed_at": "2026-10-01T10:20:31.000000Z",
      "unsubscribed_at": null,
      "created_at": "2026-10-01T10:20:31.000000Z",
      "updated_at": "2026-10-01T10:20:31.000000Z"
    },
    {
      "object": "subscriber",
      "id": "sub_4KnmYprkoMRytdkm3tAHIfPW0Vh",
      "audience_id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
      "contact_id": "con_4KiXIs4xLTcJIAHnKJaLcnMZYh7",
      "email": "grace@example.com",
      "first_name": "Grace",
      "last_name": "Hopper",
      "custom_fields": null,
      "subscribed": false,
      "subscribed_at": "2026-09-28T07:55:02.000000Z",
      "unsubscribed_at": "2026-09-30T18:11:40.000000Z",
      "created_at": "2026-09-28T07:55:02.000000Z",
      "updated_at": "2026-09-30T18:11:40.000000Z"
    }
  ],
  "next_page_url": null,
  "previous_page_url": null,
  "usage": {
    "used": 2,
    "limit": 50000,
    "plan": "pro"
  }
}
```

**404**

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

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

## Delete a subscriber — DELETE /audiences/{audience_id}/subscribers/{id}

> Remove a contact from an audience. The contact and its other audience memberships stay in your workspace.

# Delete a subscriber

Removes a contact from an audience.

`DELETE /audiences/{audience_id}/subscribers/{id}`

Requires a `full` API key. The [contact](/docs/api-reference/contacts/) itself isn't deleted and stays in its other audiences. To keep a record that someone opted out, [unsubscribe them](/docs/api-reference/audiences/subscribers/update/) with `subscribed: false` instead. Fires a `subscriber.deleted` event.

## Path parameters

- `audience_id` (string, required): The audience ID (`aud_…`) or its name.

- `id` (string, required): The subscriber ID (`sub_…`) or the contact's email address, URL-encoded.

## Returns

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

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

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

- `contact_id` (string): The contact's ID.

- `email` (string): The contact's email address.

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

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

**Node.js**

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

await emailit.subscribers.delete('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'sub_4KECYl5AwXEy8ezswYRhuddttxo');
```

**Python**

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

client.subscribers.delete("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo")
```

**PHP**

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

$emailit->subscribers()->delete('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'sub_4KECYl5AwXEy8ezswYRhuddttxo');
```

**Ruby**

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

client.subscribers.delete("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo")
```

**Go**

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

err := client.Subscribers.Delete("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo")
```

**Rust**

```rust
use emailit::Emailit;

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

emailit.subscribers.delete("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo").await?;
```

**Java**

```java
import com.emailit.*;

EmailitClient emailit = new EmailitClient("your_api_key");

emailit.subscribers().delete("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo");
```

**.NET**

```csharp
using Emailit;

var emailit = new EmailitClient("your_api_key");

emailit.Subscribers.Delete("aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2", "sub_4KECYl5AwXEy8ezswYRhuddttxo");
```

**Laravel**

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

Emailit::subscribers()->delete('aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2', 'sub_4KECYl5AwXEy8ezswYRhuddttxo');
```

**cURL**

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

**200**

```json
{
  "object": "subscriber",
  "id": "sub_4KECYl5AwXEy8ezswYRhuddttxo",
  "audience_id": "aud_4KbFmQPy1feMCGAY8F8pAhiZ1u2",
  "contact_id": "con_4K9kQdrXth7am0TPKvPrR5yd2oo",
  "email": "ada@example.com",
  "deleted": true
}
```

**404**

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

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