Skip to main content
GET
/
users
/
{user_id}
/
preferences
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: 'My API Key',
});

const preference = await client.users.preferences.retrieve('user_id');

console.log(preference.items);
{
  "paging": {
    "cursor": "<string>",
    "more": true
  },
  "items": [
    {
      "custom_routing": [
        "direct_message"
      ],
      "default_status": "OPTED_IN",
      "has_custom_routing": true,
      "status": "OPTED_IN",
      "topic_id": "<string>",
      "topic_name": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

user_id
string
required

A unique identifier associated with the user whose preferences you wish to retrieve.

Query Parameters

tenant_id
string | null

Query the preferences of a user for this specific tenant context.

Response

paging
object
required

Deprecated - Paging not implemented on this endpoint

items
UsersTopicPreference · object[]
required

The Preferences associated with the user_id.