Skip to main content
GET
/
preferences
/
sections
/
{section_id}
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 preferenceSectionGetResponse = await client.preferenceSections.retrieve('section_id');

console.log(preferenceSectionGetResponse.id);
{
  "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.

Path Parameters

section_id
string
required

Id of the preference section.

Response

A preference section in your workspace, including its topics.

id
string
required

The preference section id.

name
string
required

Human-readable name.

routing_options
enum<string>[]
required

Default channels for the section. May be empty.

Available options:
direct_message,
email,
push,
sms,
webhook,
inbox
has_custom_routing
boolean
required

Whether the section defines custom routing for its topics.

created
string
required

ISO-8601 timestamp of when the section was created.

topics
PreferenceTopicGetResponse · object[]
required

The topics contained in this section.

creator
string | null

Id of the creator.

updated
string | null

ISO-8601 timestamp of the last update.

updater
string | null

Id of the last updater.