- How To Set Up a Hosted Preference Center for a turnkey hosted page
- How To Embed Preferences in React for in-app components
Prerequisites
- Subscription topics configured in the Preferences Editor
- Templates mapped to topics
- Your Courier API key (from Settings > API Keys)
Required Parameters
Every preference update needs two identifiers:user_id- The recipient’s unique ID (same ID used in send requests)topic_id- The subscription topic ID, found in the Preferences Editor
Read a User’s Preferences
Fetch all preferences for a user to see their current opt-in/out status across all topics:Update a Topic Preference
Set a user’s opt-in status for a specific topic. Thetopic object requires a status field with one of these values:
| Status | Behavior |
|---|---|
OPTED_IN | User receives notifications for this topic |
OPTED_OUT | User does not receive notifications for this topic |
REQUIRED | User cannot opt out (use for critical notifications like security alerts) |
Custom Routing (Enterprise)
Enterprise customers can set channel delivery preferences per topic. For example, if a notification template has email, SMS, and push channels, you can let a user receive only email:Custom routing requires an Enterprise plan. The notification template must have multiple delivery channels configured and be linked to a subscription topic.
Tenant-Scoped Preferences
If your app uses tenants, pass atenant_id to read or write preferences scoped to a specific tenant: