Search subscribers

Search subscribers by their email, phone, subscriberId and name. The search is case sensitive and supports pagination.Checkout all available filters in the query section.

GET
/v2/subscribers

Authorization

Authorization<token>

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

In: header

Query Parameters

afterstring

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

beforestring

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

limitnumber

Limit the number of items to return

orderDirectionstring

Direction of sorting

Value in: "ASC" | "DESC"
orderBystring

Field to order by

includeCursorboolean

Include cursor item in response

emailstring

Email address of the subscriber to filter results.

namestring

Name of the subscriber to filter results.

phonestring

Phone number of the subscriber to filter results.

subscriberIdstring

Unique identifier of the subscriber to filter results.

Header Parameters

idempotency-keystring

A header for idempotency purposes

Response Body

OK

dataRequiredarray<object>

List of returned Subscribers

nextRequiredstring | null

The cursor for the next page of results, or null if there are no more pages.

previousRequiredstring | null

The cursor for the previous page of results, or null if this is the first page.

export interface Response {
  /**
   * List of returned Subscribers
   */
  data: SubscriberResponseDto[];
  /**
   * The cursor for the next page of results, or null if there are no more pages.
   */
  next: string | null;
  /**
   * The cursor for the previous page of results, or null if this is the first page.
   */
  previous: string | null;
}
export interface SubscriberResponseDto {
  /**
   * The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier.
   */
  _id?: string;
  /**
   * The first name of the subscriber.
   */
  firstName?: string;
  /**
   * The last name of the subscriber.
   */
  lastName?: string;
  /**
   * The email address of the subscriber.
   */
  email?: string;
  /**
   * The phone number of the subscriber.
   */
  phone?: string;
  /**
   * The URL of the subscriber's avatar image.
   */
  avatar?: string;
  /**
   * The locale setting of the subscriber, indicating their preferred language or region.
   */
  locale?: string;
  /**
   * An array of channel settings associated with the subscriber.
   *
   * @minItems 0
   */
  channels?: ChannelSettingsDto[];
  /**
   * @deprecated
   * An array of topics that the subscriber is subscribed to.
   *
   * @minItems 0
   */
  topics?: string[];
  /**
   * Indicates whether the subscriber is currently online.
   */
  isOnline?: boolean;
  /**
   * The timestamp indicating when the subscriber was last online, in ISO 8601 format.
   */
  lastOnlineAt?: string;
  /**
   * The version of the subscriber document.
   */
  __v?: number;
  /**
   * Additional custom data for the subscriber
   */
  data?: {
    [k: string]: unknown;
  } | null;
  /**
   * Timezone of the subscriber
   */
  timezone?: string;
  /**
   * The identifier used to create this subscriber, which typically corresponds to the user ID in your system.
   */
  subscriberId: string;
  /**
   * The unique identifier of the organization to which the subscriber belongs.
   */
  _organizationId: string;
  /**
   * The unique identifier of the environment associated with this subscriber.
   */
  _environmentId: string;
  /**
   * Indicates whether the subscriber has been deleted.
   */
  deleted: boolean;
  /**
   * The timestamp indicating when the subscriber was created, in ISO 8601 format.
   */
  createdAt: string;
  /**
   * The timestamp indicating when the subscriber was last updated, in ISO 8601 format.
   */
  updatedAt: string;
}
export interface ChannelSettingsDto {
  /**
   * The provider identifier for the credentials
   */
  providerId:
    | "slack"
    | "discord"
    | "msteams"
    | "mattermost"
    | "ryver"
    | "zulip"
    | "grafana-on-call"
    | "getstream"
    | "rocket-chat"
    | "whatsapp-business"
    | "fcm"
    | "apns"
    | "expo"
    | "one-signal"
    | "pushpad"
    | "push-webhook"
    | "pusher-beams";
  /**
   * The integration identifier
   */
  integrationIdentifier?: string;
  /**
   * Credentials payload for the specified provider
   */
  credentials: ChannelCredentials;
  /**
   * The unique identifier of the integration associated with this channel.
   */
  _integrationId: string;
}
export interface ChannelCredentials {
  /**
   * Webhook URL used by chat app integrations. The webhook should be obtained from the chat app provider.
   */
  webhookUrl?: string;
  /**
   * Channel specification for Mattermost chat notifications.
   */
  channel?: string;
  /**
   * Contains an array of the subscriber device tokens for a given provider. Used on Push integrations.
   *
   * @minItems 0
   */
  deviceTokens?: string[];
  /**
   * Alert UID for Grafana on-call webhook payload.
   */
  alertUid?: string;
  /**
   * Title to be used with Grafana on-call webhook.
   */
  title?: string;
  /**
   * Image URL property for Grafana on-call webhook.
   */
  imageUrl?: string;
  /**
   * State property for Grafana on-call webhook.
   */
  state?: string;
  /**
   * Link to upstream details property for Grafana on-call webhook.
   */
  externalUrl?: string;
}
 
curl -X GET "https://api.novu.co/v2/subscribers?after=string&before=string&limit=0&orderDirection=ASC&orderBy=string&includeCursor=true&email=string&name=string&phone=string&subscriberId=string" \
  -H "idempotency-key: string" \
  -H "Authorization: <token>"
{
  "data": [
    {
      "_id": "string",
      "firstName": "string",
      "lastName": "string",
      "email": "string",
      "phone": "string",
      "avatar": "string",
      "locale": "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",
      "__v": 0,
      "data": {},
      "timezone": "string",
      "subscriberId": "string",
      "_organizationId": "string",
      "_environmentId": "string",
      "deleted": true,
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "next": "string",
  "previous": "string"
}