Skip to main content
GET
/
lists
/
{list_id}
/
subscriptions
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 subscriptions = await client.lists.subscriptions.list('list_id');

console.log(subscriptions.items);
{
  "paging": {
    "cursor": "MTpFWUNFRkRRN0c1WERTRTU2",
    "more": true
  },
  "items": [
    {
      "recipientId": "abc-123",
      "created": "2024-01-15T10:30:00.000Z",
      "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"
              }
            ]
          }
        }
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

list_id
string
required

A unique identifier representing the list you wish to retrieve.

Query Parameters

cursor
string | null

A unique identifier that allows for fetching the next set of list subscriptions

Response

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