Skip to main content
PUT
/
tenants
/
{tenant_id}
/
default_preferences
/
items
/
{topic_id}
JavaScript
import Courier from '@trycourier/courier';

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

await client.tenants.preferences.items.update('topic_id', {
  tenant_id: 'tenant_id',
  status: 'OPTED_IN',
  custom_routing: ['inbox'],
  has_custom_routing: true,
});

Authorizations

Authorization
string
header
required

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

Path Parameters

tenant_id
string
required

Id of the tenant to update the default preferences for.

topic_id
string
required

Id fo the susbcription topic you want to have a default preference for.

Body

application/json
status
enum<string>
required
Available options:
OPTED_OUT,
OPTED_IN,
REQUIRED
has_custom_routing
boolean | null

Override channel routing with custom preferences. This will override any template prefernces that are set, but a user can still customize their preferences

custom_routing
enum<string>[] | null

The default channels to send to this tenant when has_custom_routing is enabled