Get subscribers
Returns a list of subscribers, could paginated using the page
and limit
query parameter
Authorization
Authorization
<token>API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".
In: header
Query Parameters
page
numberlimit
numberDefault:
10
Maximum: 100
Header Parameters
idempotency-key
stringA header for idempotency purposes
Response Body
page
RequirednumberThe current page of the paginated response
hasMore
RequiredbooleanDoes the list have more items to fetch
pageSize
RequirednumberNumber of items on each page
data
Requiredarray<object>@minItems 0
@minItems 0
export type Response = PaginatedResponseDto & {
/**
* @minItems 0
*
* @minItems 0
*/
data?: SubscriberResponseDto[];
};
export interface PaginatedResponseDto {
/**
* The current page of the paginated response
*/
page: number;
/**
* Does the list have more items to fetch
*/
hasMore: boolean;
/**
* Number of items on each page
*/
pageSize: number;
/**
* The list of items matching the query
*
* @minItems 0
*
* @minItems 0
*/
data: {}[];
}
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
*
* @minItems 0
*
* @minItems 0
*
* @minItems 0
*
* @minItems 0
*/
channels?: ChannelSettingsDto[];
/**
* @deprecated
* An array of topics that the subscriber is subscribed to.
*
* @minItems 0
*
* @minItems 0
*
* @minItems 0
*
* @minItems 0
*
* @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
*
* @minItems 0
*
* @minItems 0
*
* @minItems 0
*
* @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/v1/subscribers?page=0&limit=10" \
-H "idempotency-key: string" \
-H "Authorization: <token>"
{
"page": 0,
"hasMore": true,
"pageSize": 0,
"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"
}
]
}