GET
/
v1
/
subscribers
import { Novu } from "@novu/api";

const novu = new Novu({
  secretKey: "YOUR_SECRET_KEY_HERE",
});

async function run() {
  const result = await novu.subscribers.list();

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();
{
  "page": 123,
  "hasMore": true,
  "pageSize": 123,
  "data": [
    {
      "_id": "<string>",
      "firstName": "<string>",
      "lastName": "<string>",
      "email": "<string>",
      "phone": "<string>",
      "avatar": "<string>",
      "locale": "<string>",
      "subscriberId": "<string>",
      "channels": [
        {
          "providerId": "slack",
          "integrationIdentifier": "<string>",
          "credentials": {
            "webhookUrl": "https://example.com/webhook",
            "channel": "general",
            "deviceTokens": [
              "token1",
              "token2",
              "token3"
            ],
            "alertUid": "12345-abcde",
            "title": "Critical Alert",
            "imageUrl": "https://example.com/image.png",
            "state": "resolved",
            "externalUrl": "https://example.com/details"
          },
          "_integrationId": "<string>"
        }
      ],
      "topics": [
        "<string>"
      ],
      "isOnline": true,
      "lastOnlineAt": "<string>",
      "_organizationId": "<string>",
      "_environmentId": "<string>",
      "deleted": true,
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "__v": 123,
      "data": {},
      "timezone": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".

Headers

idempotency-key
string

A header for idempotency purposes

Query Parameters

page
number
limit
number
default:
10
Required range: x < 100

Response

200
application/json
page
number
required

The current page of the paginated response

hasMore
boolean
required

Does the list have more items to fetch

pageSize
number
required

Number of items on each page

data
object[]
required

The list of items matching the query