Skip to main content
GET
/
bulk
/
{job_id}
/
users
JavaScript
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": [
    {
      "preferences": {
        "categories": {
          "categories_key": {
            "status": "OPTED_IN",
            "rules": [
              {
                "start": "string",
                "until": "string"
              }
            ],
            "channel_preferences": [
              {
                "channel": "direct_message"
              }
            ]
          }
        },
        "notifications": {
          "notifications_key": {
            "status": "OPTED_IN",
            "rules": [
              {
                "start": "string",
                "until": "string"
              }
            ],
            "channel_preferences": [
              {
                "channel": "direct_message"
              }
            ]
          }
        }
      },
      "profile": {},
      "recipient": "string",
      "data": {},
      "to": {
        "user_id": "user_123",
        "account_id": "abc-123",
        "context": {
          "tenant_id": "tenant_abc"
        },
        "data": {},
        "email": "user@example.com",
        "locale": "en-US",
        "phone_number": "+15551234567",
        "list_id": "example.list.id",
        "preferences": {
          "categories": {
            "categories_key": {
              "status": "OPTED_IN",
              "rules": [
                {
                  "start": "string",
                  "until": "string"
                }
              ],
              "channel_preferences": [
                {
                  "channel": "direct_message"
                }
              ],
              "source": "subscription"
            }
          },
          "notifications": {
            "notifications_key": {
              "status": "OPTED_IN",
              "rules": [
                {
                  "start": "string",
                  "until": "string"
                }
              ],
              "channel_preferences": [
                {
                  "channel": "direct_message"
                }
              ],
              "source": "subscription"
            }
          },
          "templateId": "TGB7VST3R0PWBHBJD9R6ZMG2DD9A"
        },
        "tenant_id": "tenant_abc"
      },
      "status": "PENDING",
      "messageId": "1-5e2b2615-05efbb3acab9172f88dd3f6f"
    }
  ],
  "paging": {
    "cursor": "MTpFWUNFRkRRN0c1WERTRTU2",
    "more": true
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

job_id
string
required

A unique identifier representing the bulk job

Query Parameters

cursor
string | null

A unique identifier that allows for fetching the next set of users added to the bulk job

Response

items
BulkMessageUserResponse · object[]
required
paging
Paging · object
required