import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const response = await client.bulk.listUsers('job_id');
console.log(response.items);{
"items": [
{
"status": "PENDING",
"preferences": {
"categories": {},
"notifications": {}
},
"profile": {},
"recipient": "<string>",
"data": "<unknown>",
"to": {
"user_id": "<string>",
"account_id": "<string>",
"context": {
"tenant_id": "<string>"
},
"data": {},
"email": "<string>",
"locale": "<string>",
"phone_number": "<string>",
"list_id": "<string>",
"preferences": {
"notifications": {},
"categories": {},
"templateId": "<string>"
},
"tenant_id": "<string>"
},
"messageId": "<string>"
}
],
"paging": {
"more": true,
"cursor": "<string>"
}
}Get Bulk Job Users
import Courier from '@trycourier/courier';
const client = new Courier({
apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});
const response = await client.bulk.listUsers('job_id');
console.log(response.items);{
"items": [
{
"status": "PENDING",
"preferences": {
"categories": {},
"notifications": {}
},
"profile": {},
"recipient": "<string>",
"data": "<unknown>",
"to": {
"user_id": "<string>",
"account_id": "<string>",
"context": {
"tenant_id": "<string>"
},
"data": {},
"email": "<string>",
"locale": "<string>",
"phone_number": "<string>",
"list_id": "<string>",
"preferences": {
"notifications": {},
"categories": {},
"templateId": "<string>"
},
"tenant_id": "<string>"
},
"messageId": "<string>"
}
],
"paging": {
"more": true,
"cursor": "<string>"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
A unique identifier representing the bulk job
A unique identifier that allows for fetching the next set of users added to the bulk job