API Reference
Subscribers
- GETGet subscribers
- POSTCreate subscriber
- POSTBulk create subscribers
- GETGet subscriber
- PUTUpsert subscriber
- DELDelete subscriber
- PUTUpdate subscriber credentials
- DELDelete subscriber credentials by providerId
- PATCHUpdate subscriber online status
- GETGet subscriber preferences
- GETGet subscriber global preferences
- PATCHUpdate subscriber preference
- PATCHUpdate subscriber global preferences
- GETGet in-app notification feed for a particular subscriber
- GETGet the unseen in-app notifications count for subscribers feed
- POSTMark a subscriber feed message as seen
- 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
Topics
Notification
Workflows
Workflow Overrides
Workflow groups
Integrations
Layouts
Execution Details
Organizations
Trigger event
Trigger event is the main (and only) way to send notifications to subscribers. The trigger identifier is used to match the particular workflow associated with it. Additional information can be passed according the body interface below.
import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>',
{
to: {
subscriberId: '<UNIQUE_SUBSCRIBER_IDENTIFIER>',
email: '[email protected]',
firstName: 'John',
lastName: 'Doe',
},
payload: {
name: "Hello World",
organization: {
logo: 'https://happycorp.com/logo.png',
},
},
}
);
{
"data": {
"acknowledged": true,
"status": "processed",
"transactionId": "string"
}
}
Enter your API key in the Authorization
field like the example shown below:
E.g ApiKey 18d2e625f05d80e
import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>',
{
to: {
subscriberId: '<UNIQUE_SUBSCRIBER_IDENTIFIER>',
email: '[email protected]',
firstName: 'John',
lastName: 'Doe',
},
payload: {
name: "Hello World",
organization: {
logo: 'https://happycorp.com/logo.png',
},
},
}
);
{
"data": {
"acknowledged": true,
"status": "processed",
"transactionId": "string"
}
}
The transactionId
within Novu is a unique identifier that is used to ensure the idempotent nature of notification delivery.
When you trigger an event to send a notification, you have the option to provide a transactionId
. If you do not provide one, Novu will generate a UUID for you.
This identifier is particularly useful for preventing the same notification from being sent multiple times in case the trigger event is inadvertently called more than once.
By leveraging the transactionId
, you can make idempotent requests, which means if the same transactionId
is used in another request, Novu’s API will recognize it and will not send the same notification again.
This upholds the principle of idempotency, ensuring that the effect of the operation is the same, no matter how many times the request is repeated with the same transactionId
.
Authorizations
API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".
Body
Response
The response is of type object
.
Was this page helpful?
import { Novu } from '@novu/node';
const novu = new Novu("<NOVU_API_KEY>");
await novu.trigger('<WORKFLOW_TRIGGER_IDENTIFIER>',
{
to: {
subscriberId: '<UNIQUE_SUBSCRIBER_IDENTIFIER>',
email: '[email protected]',
firstName: 'John',
lastName: 'Doe',
},
payload: {
name: "Hello World",
organization: {
logo: 'https://happycorp.com/logo.png',
},
},
}
);
{
"data": {
"acknowledged": true,
"status": "processed",
"transactionId": "string"
}
}