Identify User, Set Preferences, and Trigger
A 3-step recipe with Knock. We can help you get access.
Recipe · 3 steps
Identify User, Set Preferences, and Trigger
with Knock
Works with AI assistants
Identify a user, set their preference set, and trigger a workflow.
- Create or update the user record with the supplied identification properties so the recipient exists before preferences are written.
- Write the complete preference set for the identified user, replacing any existing preferences with the supplied channel types and workflow opt-ins.
- Trigger the named workflow for the identified recipient. Returns a workflow_run_id that can be used to track the resulting messages.
What you'll need to have ready
- apiKey: Knock secret API key (sk_...) used as a Bearer token.
- userId: The unique identifier of the user to identify and notify.
- email: The primary email address to set on the user.
- name: The display name to set on the user.
- preferenceSetId: The preference set identifier to update (defaults to "default").
- channelTypes: A map of channel type names to boolean opt-in values.
- workflowPreferences: A map of workflow keys to per-workflow preference settings.
- workflowKey: The key of the workflow to trigger.
- data: Optional data payload passed into the workflow run.
For your developer
Arazzo workflow knock-app:identify-user-set-preferences-trigger-workflow, 3 operations: identifyUser → updateUserPreferenceSet → {$sourceDescriptions.workflowsApi.url}#/paths/~1v1~1workflows~1{key}~1trigger/post. Specs on APIs.io.