Skip to main content
GET
/
preferences
/
sections
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 preferenceSectionListResponse = await client.preferenceSections.list();

console.log(preferenceSectionListResponse.results);
{
  "results": [
    {
      "id": "<string>",
      "name": "<string>",
      "routing_options": [],
      "has_custom_routing": true,
      "created": "<string>",
      "topics": [
        {
          "id": "<string>",
          "name": "<string>",
          "routing_options": [],
          "allowed_preferences": [],
          "include_unsubscribe_header": true,
          "topic_data": {},
          "created": "<string>",
          "updated": "<string>",
          "creator": "<string>",
          "updater": "<string>"
        }
      ],
      "creator": "<string>",
      "updated": "<string>",
      "updater": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Response

200 - application/json

The workspace's preference sections, each with its topics.

results
PreferenceSectionGetResponse · object[]
required