API Reference
Notifications
Integrations
Subscribers
- GETGet subscribers
- POSTBulk create subscribers
- PUTUpdate subscriber credentials
- PATCHModify subscriber credentials
- DELDelete subscriber credentials by providerId
- PATCHUpdate subscriber online status
- GETGet in-app notification feed for a particular subscriber
- GETGet the unseen in-app notifications count for subscribers feed
- POSTMark a subscriber messages as seen, read, unseen or unread
- POSTMarks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.
- POSTMark message action as seen
- GETHandle providers oauth redirect
- GETHandle chat oauth
- GETSearch for subscribers
- POSTCreate subscriber
- GETGet subscriber
- DELDelete subscriber
- PATCHPatch subscriber
- GETGet subscriber preferences
- PATCHUpdate subscriber global or workflow specific preferences
Search for subscribers
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_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": {},
"timezone": "<string>"
}
],
"next": "<string>",
"previous": "<string>"
}
Authorizations
API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".
Headers
A header for idempotency purposes
Query Parameters
Cursor for pagination indicating the starting point after which to fetch results.
Cursor for pagination indicating the ending point before which to fetch results.
Email address of the subscriber to filter results.
Name of the subscriber to filter results.
Phone number of the subscriber to filter results.
Unique identifier of the subscriber to filter results.
ASC
, DESC
Response
List of returned Subscribers
The identifier used to create this subscriber, which typically corresponds to the user ID in your system.
The unique identifier of the organization to which the subscriber belongs.
The unique identifier of the environment associated with this subscriber.
Indicates whether the subscriber has been deleted.
The timestamp indicating when the subscriber was created, in ISO 8601 format.
The timestamp indicating when the subscriber was last updated, in ISO 8601 format.
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.
The first name of the subscriber.
The last name of the subscriber.
The email address of the subscriber.
The phone number of the subscriber.
The URL of the subscriber's avatar image.
The locale setting of the subscriber, indicating their preferred language or region.
An array of channel settings associated with the subscriber.
The provider identifier for the credentials
slack
, discord
, msteams
, mattermost
, ryver
, zulip
, grafana-on-call
, getstream
, rocket-chat
, whatsapp-business
, fcm
, apns
, expo
, one-signal
, pushpad
, push-webhook
, pusher-beams
Credentials payload for the specified provider
Webhook URL used by chat app integrations. The webhook should be obtained from the chat app provider.
Channel specification for Mattermost chat notifications.
Contains an array of the subscriber device tokens for a given provider. Used on Push integrations.
Alert UID for Grafana on-call webhook payload.
Title to be used with Grafana on-call webhook.
Image URL property for Grafana on-call webhook.
State property for Grafana on-call webhook.
Link to upstream details property for Grafana on-call webhook.
The unique identifier of the integration associated with this channel.
The integration identifier
An array of topics that the subscriber is subscribed to.
Indicates whether the subscriber is currently online.
The timestamp indicating when the subscriber was last online, in ISO 8601 format.
The version of the subscriber document.
Additional custom data for the subscriber
Timezone of the subscriber
The cursor for the next page of results, or null if there are no more pages.
The cursor for the previous page of results, or null if this is the first page.
Was this page helpful?
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_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": {},
"timezone": "<string>"
}
],
"next": "<string>",
"previous": "<string>"
}