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
Get notification
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "YOUR_SECRET_KEY_HERE",
});
async function run() {
const result = await novu.notifications.retrieve("<id>");
// Handle the result
console.log(result);
}
run();
{
"_id": "<string>",
"_environmentId": "<string>",
"_organizationId": "<string>",
"_subscriberId": "<string>",
"transactionId": "<string>",
"_templateId": "<string>",
"_digestedNotificationId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"channels": [
"in_app"
],
"subscriber": {
"firstName": "<string>",
"subscriberId": "<string>",
"_id": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>"
},
"template": {
"_id": "<string>",
"name": "<string>",
"origin": "novu-cloud",
"triggers": [
{
"type": "event",
"identifier": "<string>",
"variables": [
{
"name": "<string>"
}
],
"subscriberVariables": [
{
"name": "<string>"
}
]
}
]
},
"jobs": [
{
"_id": "<string>",
"type": "in_app",
"digest": {
"digestKey": "<string>",
"amount": 123,
"unit": "seconds",
"type": "regular",
"events": [
{}
],
"backoff": true,
"backoffAmount": 123,
"backoffUnit": "seconds",
"updateMode": true,
"timed": {
"atTime": "<string>",
"weekDays": [
"monday"
],
"monthDays": [
123
],
"ordinal": "1",
"ordinalValue": "day",
"monthlyType": "each",
"cronExpression": "<string>"
}
},
"executionDetails": [
{
"_id": "<string>",
"createdAt": "<string>",
"status": "Success",
"detail": "<string>",
"isRetry": true,
"isTest": true,
"providerId": "emailjs",
"raw": "<string>",
"source": "Credentials"
}
],
"step": {
"_id": "<string>",
"active": true,
"replyCallback": {},
"controlVariables": {},
"metadata": {},
"issues": {},
"filters": [
{
"isNegated": true,
"type": "BOOLEAN",
"value": "AND",
"children": [
{
"field": "<string>",
"value": "<string>",
"operator": "LARGER",
"on": "subscriber"
}
]
}
],
"template": {},
"variants": [
{}
],
"_templateId": "<string>",
"name": "<string>",
"_parentId": "<string>"
},
"payload": {},
"providerId": "emailjs",
"status": "<string>",
"updatedAt": "<string>"
}
],
"payload": {},
"tags": [
"<string>"
],
"controls": {},
"to": {}
}
Authorizations
API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".
Headers
A header for idempotency purposes
Path Parameters
Response
Environment ID of the notification
Organization ID of the notification
Subscriber ID of the notification
Transaction ID of the notification
Unique identifier of the notification
Template ID of the notification
Digested Notification ID
Creation time of the notification
Last updated time of the notification
Channels of the notification
in_app
, email
, sms
, chat
, push
, digest
, trigger
, delay
, custom
Subscriber of the notification
External unique identifier of the subscriber
Internal to Novu unique identifier of the subscriber
First name of the subscriber
Last name of the subscriber
Email address of the subscriber
Phone number of the subscriber
Template of the notification
Name of the template
Triggers of the template
Type of the trigger
event
Identifier of the trigger
Variables of the trigger
Name of the variable
Unique identifier of the template
Origin of the workflow
novu-cloud
, novu-cloud-v1
, external
Jobs of the notification
Unique identifier of the job
Type of the job
in_app
, email
, sms
, chat
, push
, digest
, trigger
, delay
, custom
Execution details of the job
Unique identifier of the execution detail
Status of the execution detail
Success
, Warning
, Failed
, Pending
, Queued
, ReadConfirmation
Detailed information about the execution
Whether the execution is a retry or not
Whether the execution is a test or not
Provider ID of the job
emailjs
, mailgun
, mailjet
, mandrill
, nodemailer
, postmark
, sendgrid
, sendinblue
, ses
, netcore
, infobip-email
, resend
, plunk
, mailersend
, mailtrap
, clickatell
, outlook365
, novu-email
, sparkpost
, email-webhook
, braze
, nexmo
, plivo
, sms77
, sms-central
, sns
, telnyx
, twilio
, gupshup
, firetext
, infobip-sms
, burst-sms
, bulk-sms
, isend-sms
, forty-six-elks
, kannel
, maqsam
, termii
, africas-talking
, novu-sms
, sendchamp
, generic-sms
, clicksend
, bandwidth
, messagebird
, simpletexting
, azure-sms
, ring-central
, brevo-sms
, eazy-sms
, mobishastra
, fcm
, apns
, expo
, one-signal
, pushpad
, push-webhook
, pusher-beams
, novu
, slack
, discord
, msteams
, mattermost
, ryver
, zulip
, grafana-on-call
, getstream
, rocket-chat
, whatsapp-business
Source of the execution detail
Credentials
, Internal
, Payload
, Webhook
Creation time of the execution detail
Raw data of the execution
Step details of the job
Unique identifier of the step
Whether the step is active or not
Filter criteria for the step
BOOLEAN
, TEXT
, DATE
, NUMBER
, STATEMENT
, LIST
, MULTI_LIST
, GROUP
AND
, OR
LARGER
, SMALLER
, LARGER_EQUAL
, SMALLER_EQUAL
, EQUAL
, NOT_EQUAL
, ALL_IN
, ANY_IN
, NOT_IN
, BETWEEN
, NOT_BETWEEN
, LIKE
, NOT_LIKE
, IN
subscriber
, payload
The identifier for the template associated with this step
Reply callback settings
Control variables
Metadata for the workflow step
Step issues
Optional template for the step
Variants of the step
Unique identifier of the step
Whether the step is active or not
Filter criteria for the step
BOOLEAN
, TEXT
, DATE
, NUMBER
, STATEMENT
, LIST
, MULTI_LIST
, GROUP
AND
, OR
The identifier for the template associated with this step
Reply callback settings
Control variables
Metadata for the workflow step
Step issues
Optional template for the step
Variants of the step
Unique identifier of the step
Whether the step is active or not
Filter criteria for the step
The identifier for the template associated with this step
Reply callback settings
Control variables
Metadata for the workflow step
Step issues
Optional template for the step
Variants of the step
The name of the step
The unique identifier for the parent step
The name of the step
The unique identifier for the parent step
The name of the step
The unique identifier for the parent step
Provider ID of the job
emailjs
, mailgun
, mailjet
, mandrill
, nodemailer
, postmark
, sendgrid
, sendinblue
, ses
, netcore
, infobip-email
, resend
, plunk
, mailersend
, mailtrap
, clickatell
, outlook365
, novu-email
, sparkpost
, email-webhook
, braze
, nexmo
, plivo
, sms77
, sms-central
, sns
, telnyx
, twilio
, gupshup
, firetext
, infobip-sms
, burst-sms
, bulk-sms
, isend-sms
, forty-six-elks
, kannel
, maqsam
, termii
, africas-talking
, novu-sms
, sendchamp
, generic-sms
, clicksend
, bandwidth
, messagebird
, simpletexting
, azure-sms
, ring-central
, brevo-sms
, eazy-sms
, mobishastra
, fcm
, apns
, expo
, one-signal
, pushpad
, push-webhook
, pusher-beams
, novu
, slack
, discord
, msteams
, mattermost
, ryver
, zulip
, grafana-on-call
, getstream
, rocket-chat
, whatsapp-business
Status of the job
Optional digest for the job, including metadata and events
The Digest Type
regular
, backoff
, timed
Optional key for the digest
Amount for the digest
Unit of the digest
seconds
, minutes
, hours
, days
, weeks
, months
Optional array of events associated with the digest, represented as key-value pairs
Regular digest: Indicates if backoff is enabled for the regular digest
Regular digest: Amount for backoff
Regular digest: Unit for backoff
seconds
, minutes
, hours
, days
, weeks
, months
Regular digest: Indicates if the digest should update
Configuration for timed digest
Time at which the digest is triggered
Days of the week for the digest
monday
, tuesday
, wednesday
, thursday
, friday
, saturday
, sunday
Specific days of the month for the digest
Ordinal position for the digest
1
, 2
, 3
, 4
, 5
, last
Value of the ordinal
day
, weekday
, weekend
, sunday
, monday
, tuesday
, wednesday
, thursday
, friday
, saturday
Type of monthly schedule
each
, on
Cron expression for scheduling
Optional payload for the job
Updated time of the notification
Payload of the notification
Tags associated with the notification
Controls associated with the notification
To field for subscriber definition
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.notifications.retrieve("<id>");
// Handle the result
console.log(result);
}
run();
{
"_id": "<string>",
"_environmentId": "<string>",
"_organizationId": "<string>",
"_subscriberId": "<string>",
"transactionId": "<string>",
"_templateId": "<string>",
"_digestedNotificationId": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"channels": [
"in_app"
],
"subscriber": {
"firstName": "<string>",
"subscriberId": "<string>",
"_id": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>"
},
"template": {
"_id": "<string>",
"name": "<string>",
"origin": "novu-cloud",
"triggers": [
{
"type": "event",
"identifier": "<string>",
"variables": [
{
"name": "<string>"
}
],
"subscriberVariables": [
{
"name": "<string>"
}
]
}
]
},
"jobs": [
{
"_id": "<string>",
"type": "in_app",
"digest": {
"digestKey": "<string>",
"amount": 123,
"unit": "seconds",
"type": "regular",
"events": [
{}
],
"backoff": true,
"backoffAmount": 123,
"backoffUnit": "seconds",
"updateMode": true,
"timed": {
"atTime": "<string>",
"weekDays": [
"monday"
],
"monthDays": [
123
],
"ordinal": "1",
"ordinalValue": "day",
"monthlyType": "each",
"cronExpression": "<string>"
}
},
"executionDetails": [
{
"_id": "<string>",
"createdAt": "<string>",
"status": "Success",
"detail": "<string>",
"isRetry": true,
"isTest": true,
"providerId": "emailjs",
"raw": "<string>",
"source": "Credentials"
}
],
"step": {
"_id": "<string>",
"active": true,
"replyCallback": {},
"controlVariables": {},
"metadata": {},
"issues": {},
"filters": [
{
"isNegated": true,
"type": "BOOLEAN",
"value": "AND",
"children": [
{
"field": "<string>",
"value": "<string>",
"operator": "LARGER",
"on": "subscriber"
}
]
}
],
"template": {},
"variants": [
{}
],
"_templateId": "<string>",
"name": "<string>",
"_parentId": "<string>"
},
"payload": {},
"providerId": "emailjs",
"status": "<string>",
"updatedAt": "<string>"
}
],
"payload": {},
"tags": [
"<string>"
],
"controls": {},
"to": {}
}