import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
await novu.subscribers.bulkCreate([
{
subscriberId: 'test-subscriber-1',
email: '[email protected]',
firstName: 'subscriber-1',
lastName: 'test-1',
},
{
subscriberId: 'test-subscriber-2',
email: '[email protected]',
firstName: 'subscriber-2',
lastName: 'test-2',
},
{
subscriberId: 'test-subscriber-3',
},
]);
{
"data": {
"updated": [],
"created": [
{
"subscriberId": "test-subscriber-1"
},
{
"subscriberId": "test-subscriber-2"
},
{
"subscriberId": "test-subscriber-3"
}
],
"failed": []
}
}
Using this endpoint multiple subscribers can be created at once. The bulk API is limited to 500 subscribers per request.
import { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
await novu.subscribers.bulkCreate([
{
subscriberId: 'test-subscriber-1',
email: '[email protected]',
firstName: 'subscriber-1',
lastName: 'test-1',
},
{
subscriberId: 'test-subscriber-2',
email: '[email protected]',
firstName: 'subscriber-2',
lastName: 'test-2',
},
{
subscriberId: 'test-subscriber-3',
},
]);
{
"data": {
"updated": [],
"created": [
{
"subscriberId": "test-subscriber-1"
},
{
"subscriberId": "test-subscriber-2"
},
{
"subscriberId": "test-subscriber-3"
}
],
"failed": []
}
}
Authorization field like the example shown below:E.g ApiKey 18d2e625f05d80eimport { Novu } from '@novu/node';
const novu = new Novu('<NOVU_API_KEY>');
await novu.subscribers.bulkCreate([
{
subscriberId: 'test-subscriber-1',
email: '[email protected]',
firstName: 'subscriber-1',
lastName: 'test-1',
},
{
subscriberId: 'test-subscriber-2',
email: '[email protected]',
firstName: 'subscriber-2',
lastName: 'test-2',
},
{
subscriberId: 'test-subscriber-3',
},
]);
{
"data": {
"updated": [],
"created": [
{
"subscriberId": "test-subscriber-1"
},
{
"subscriberId": "test-subscriber-2"
},
{
"subscriberId": "test-subscriber-3"
}
],
"failed": []
}
}
API key authentication. Allowed headers-- "Authorization: ApiKey <api_key>".
Show child attributes
The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems
An http url to the profile image of your subscriber
Was this page helpful?