# Subscribers API Reference

Source: https://instatus.com/help/api/subscribers

## Get subscribers

**Endpoint:**

```bash
GET /v2/:page_id/subscribers?page=:page&per_page=:per_page&search=:search_query&status=:status
```

- The default page number is 1.
- The default per_page number is 50 and the maximum is 100 items per page.
- Optional search query is used to filter subscribers using email address or phone number.
- Optional `status` filters subscribers by their subscription status. Use `status=confirmed` to leave out anyone who hasn't confirmed yet.

| Value | Subscribers returned |
| --- | --- |
| `confirmed` | Confirmed subscribers who receive notifications. |
| `unconfirmed` | Approved subscribers who haven't confirmed their subscription yet. |
| `unapproved` | Subscribers waiting for approval, such as imported lists. |

**Example response**

```json
[
  {
    "id": "cm1111x6ofgsd5666mzxcw978qh",
    "email": "ali@instatus.com",
    "phone": null,
    "webhook": null,
    "webhookEmail": null,
    "confirmed": false,
    "approved": true,
    "all": true,
    "components": []
  },
  {
    "id": "cm1111x6ofgsd5666mzxcw978qh",
    "email": null,
    "phone": "5417543010",
    "webhook": null,
    "webhookEmail": null,
    "confirmed": false,
    "approved": true,
    "all": true,
    "components": []
  }
]
```

## Add a subscriber

**Endpoint:**

```bash
POST /v1/:page_id/subscribers
```

When someone subscribes, confirmation behavior follows the page's `subscriberConfirmationMode` setting. Use `autoConfirm` on this endpoint to override that behavior for a single subscriber.

**Example request**

```json
{
  "email": "sarah@instatus.com",
  "all": true,
  "autoConfirm": false
}
```

- `autoConfirm` — optional. When `true`, adds the subscriber immediately without sending confirmation or welcome emails, regardless of the page setting. Pro only. The first use on a page is reviewed by Instatus; until it is approved, the subscriber receives a confirmation email instead.

**Example response**

```json
{
  "id": "cm1111x6ofgsd5666mzxcw978df",
  "name": null,
  "email": "sarahs@instatus.com",
  "phone": null,
  "confirmed": false,
  "all": true,
  "createdAt": "2024-10-01T03:48:41.474Z",
  "updatedAt": "2024-10-01T03:48:41.474Z",
  "siteId": "cm1111x6ofgsd5666mzxcw978qh",
  "unsubscribeToken": "e3b51de6-1234-4664-zxyv-1679gg524260",
  "webhook": null,
  "webhookEmail": null,
  "discord": null,
  "discordTeam": null,
  "slack": null,
  "slackTeam": null,
  "language": "en",
  "company": null,
  "microsoftTeamsWebhook": null,
  "googleChatWebhook": null,
  "googleChatSpace": null,
  "failedAttempts": 0,
  "approved": true,
  "importedFrom": null,
  "hideUnsubLink": false,
  "webhookIncidentBody": null,
  "webhookMaintenanceBody": null,
  "webhookComponentBody": null,
  "webhookHttpMethod": "POST",
  "webhookHeaders": null,
  "site": {
    "id": "cm1111x6ofgsd5666mzxcw978qh"
  }
}
```

### Subscribe to specific components

**Example request**

```json
{
  "email": "adam@instatus.com",
  "all": false,
  "components": ["cl2xv23rl0119e7jlk2mweepd"],
  "autoConfirm": false
}
```

**Example response**

```json
{
  "id": "cl09gt11151422bjluflghewx",
  "email": "adam@instatus.com",
  "site": {
    "id": "ckg8a112344s5v86wrn",
    "name": "Test",
    "logoUrl": null,
    "subdomain": "test",
    "publicEmail": null,
    "language": "en"
  }
}
```

## Add multiple subscribers

**Endpoint:**

```bash
POST /v1/:page_id/subscribers/bulk
```

This endpoint allows you to create multiple subscribers in a single request.

**Example request**

```json
{
  "subscribers": [
    {
      "email": "sarah@instatus.com",
      "all": true
    },
    {
      "email": "john@instatus.com",
      "components": ["cl2xv23rl0119e7jlk2mweepd"]
    },
    {
      "name": "Jane Doe",
      "phone": "5417543010",
      "all": true
    }
  ],
  "autoConfirm": false
}
```

- `autoConfirm` applies to every subscriber in the batch. Pro only.

**Example response**

```json
{
  "success": true,
  "created": 3,
  "failed": 0,
  "results": {
    "created": [
      {
        "id": "cm1111x6ofgsd5666mzxcw978df",
        "email": "sarah@instatus.com",
        "phone": null,
        "confirmed": false,
        "all": true,
        "site": {
          "id": "cm1111x6ofgsd5666mzxcw978qh"
        }
      },
      {
        "id": "cm2222x6ofgsd5666mzxcw978df",
        "email": "john@instatus.com",
        "phone": null,
        "confirmed": false,
        "all": false,
        "site": {
          "id": "cm1111x6ofgsd5666mzxcw978qh"
        }
      },
      {
        "id": "cm3333x6ofgsd5666mzxcw978df",
        "email": null,
        "phone": "5417543010",
        "name": "Jane Doe",
        "confirmed": false,
        "all": true,
        "site": {
          "id": "cm1111x6ofgsd5666mzxcw978qh"
        }
      }
    ],
    "failed": []
  }
}
```

**Response when some subscribers fail**

If some subscribers fail to be created (e.g., duplicate email, incorrect format), the response will include details about the failures:

```json
{
  "success": false,
  "created": 2,
  "failed": 1,
  "results": {
    "created": [
      {
        "id": "cm1111x6ofgsd5666mzxcw978df",
        "email": "sarah@instatus.com",
        "site": {
          "id": "cm1111x6ofgsd5666mzxcw978qh"
        }
      },
      {
        "id": "cm2222x6ofgsd5666mzxcw978df",
        "email": "john@instatus.com",
        "site": {
          "id": "cm1111x6ofgsd5666mzxcw978qh"
        }
      }
    ],
    "failed": [
      {
        "index": 2,
        "subscriber": {
          "email": "duplicate@instatus.com",
          "all": true
        },
        "error": {
          "code": "creation_failed",
          "message": "Subscriber with this email already exists"
        }
      }
    ]
  }
}
```

**Notes:**

- Maximum 100 subscribers per request
- Each subscriber object can have the same fields as the single subscriber endpoint
- Partial success is supported - successfully created subscribers are returned even if some fail

## Confirmation behavior

Status pages control how new subscribers are handled via `subscriberConfirmationMode` on the [Update a status page](https://instatus.com/help/api/status-pages) endpoint:

| Value | Behavior |
| --- | --- |
| `REQUIRED` | Subscribers must confirm via email before receiving updates. Default. |
| `WELCOME` | Subscribers are added immediately and receive a welcome email. Pro only. |
| `NONE` | Subscribers are added immediately with no email. Pro only. |

The `autoConfirm` parameter on create endpoints overrides the page setting for that request and behaves like `NONE`.

## Remove a subscriber

**Endpoint:**

```bash
DELETE /v1/:page_id/subscribers/:subscriber_id
```

**Example response**

```json
{
  "id": "cm1zvzm3434dlp9255d6jgy8",
  "name": null,
  "email": "sarah@instatus.com",
  "phone": null,
  "webhook": null,
  "webhookEmail": null,
  "discord": null,
  "microsoftTeamsWebhook": null,
  "company": null,
  "site": {
    "id": "cm180slpo000g9343478qh"
  }
}
```
