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

const novu = new Novu({
  secretKey: "<YOUR_API_KEY_HERE>",
});

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

  // Handle the result
  console.log(result);
}

run();
{
  "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": {}
    }
  ],
  "next": "<string>",
  "previous": "<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

after
string

Cursor for pagination indicating the starting point after which to fetch results.

before
string

Cursor for pagination indicating the ending point before which to fetch results.

email
string

Email address of the subscriber to filter results.

name
string

Name of the subscriber to filter results.

phone
string

Phone number of the subscriber to filter results.

subscriberId
string

Unique identifier of the subscriber to filter results.

limit
number
orderDirection
enum<string>
Available options:
ASC,
DESC
orderBy
any

Response

200
application/json

OK

The response is of type object.