Replace user preferences in bulk
Replace a user’s complete set of preference overrides in a single request. The topics in the request body become the recipient’s entire set of overrides: listed topics are created or updated, and every existing override that is not included in the body is reset to its topic default. Submitting an empty topics array is a valid clear-all that resets every existing override.
This operation is validation-atomic (all-or-nothing): structural validation fails fast with a single 400, and if any topic is semantically invalid (an unknown topic, a REQUIRED topic that cannot be opted out, or a custom routing request that is not available on the workspace’s plan) the request returns a single 400 aggregating every failure in errors and writes nothing. On success it returns 200 with items (the complete resulting override set) and deleted (the ids of the overrides that were reset to default).
Every topic_id in the response — in items, deleted, and any errors — is returned in Courier’s canonical topic id form, regardless of the form supplied in the request.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
A unique identifier associated with the user whose preferences you wish to update.
Query Parameters
Replace the preferences of a user for this specific tenant context.
Body
The complete set of topic overrides for the user. Up to 50 topics may be provided. Any existing override not listed here is reset to its topic default; an empty array resets every existing override.
50Response
The replacement was applied. items contains the complete resulting set of topic overrides for the user, and deleted lists the ids of the overrides that were reset to their topic default.