Skip to content

Channel preferences

Use this reference with the complete developer tour and TypeScript types. The example at the end runs after the tour setup.

Read a Person’s versioned delivery defaults and Agent/Agent-role overrides.

deliveryPreferences(personId: string): Promise<DeliveryPreferences>
Parameter Type and default Usage
personId string (required) Stable recipient Person identity ID.

Returns: DeliveryPreferences with person_id, version, default and ordered overrides.

Permissions, lifecycle and errors: Person self, administrator or authorized identity manager only. Reload after a stale-version conflict; preferences grant no contact authority.

Declared return type: Promise<DeliveryPreferences>.

Working TypeScript example. Input/output fields are in the types reference.

Save a Person’s channel policy using its observed version.

saveDeliveryPreferences(personId: string, preferences: DeliveryPreferences): Promise<DeliveryPreferences>
Parameter Type and default Usage
personId string (required) Stable recipient Person identity ID.
preferences DeliveryPreferences (required) The recipient delivery preferences to save, including the observed version, default policy and ordered overrides.

Returns: DeliveryPreferences with the incremented version; pending external sends from the previous configuration stop.

Permissions, lifecycle and errors: Person self, administrator or authorized identity manager only. Reload after a stale-version conflict; preferences grant no contact authority.

Declared return type: Promise<DeliveryPreferences>.

Working TypeScript example. Input/output fields are in the types reference.

Run this region after the shared setup. Assertions check the returned data; the full tour is a runnable program.

const preferences = await owner.deliveryPreferences(personId);
const savedPreferences = await owner.saveDeliveryPreferences(personId, {person_id: personId, version: preferences.version,
default: {mode: 'preferred', destinations: [], followup_seconds: 0}, overrides: []});
assert.ok(savedPreferences.version > preferences.version);

Read this page as Markdown