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": "<unknown>",
"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": "<unknown>",
"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
Show child attributes
PENDING, ENQUEUED, ERROR Show child attributes
Show child attributes
Show child attributes
OPTED_IN, OPTED_OUT, REQUIRED Show child attributes
Show child attributes
OPTED_IN, OPTED_OUT, REQUIRED Show child attributes
The user's unique identifier. Typically, this will match the user id of a user in your system.
Deprecated - Use tenant_id instead.
The user's email address.
The user's preferred ISO 639-1 language code.
The user's phone number.
The id of the list to send the message to.
Show child attributes
Show child attributes
Show child attributes
OPTED_IN, OPTED_OUT, REQUIRED subscription, list, recipient Show child attributes
Show child attributes
OPTED_IN, OPTED_OUT, REQUIRED subscription, list, recipient The id of the tenant the user is associated with.