Amplitude source
Send Amplitude events, user updates, and cohort membership changes to Knock to trigger workflows and keep users and audiences in sync.
The Amplitude source enables you to send analytics events, user updates, and cohort membership changes from Amplitude to Knock. Knock receives Amplitude's default webhook payloads, verifies a shared secret, identifies the incoming event type, and runs the actions you configure.
You can connect either or both of Amplitude's outbound webhook integrations to the same Knock source URL:
- Webhooks Streaming sends product events and user property updates as Amplitude ingests them.
- Cohort Webhooks sends batches when users enter or exit an Amplitude cohort.
Use these integrations to trigger notification workflows from product behavior, keep Knock user properties aligned with Amplitude, or use an Amplitude cohort as a Knock audience.
How verification works
#Amplitude supports custom headers but does not sign Webhooks Streaming or Cohort Webhook requests. The Knock source verifies a shared secret sent as a Bearer token in the Authorization header:
The signing secret in Knock must match the token configured in every Amplitude destination that sends data to the source. Treat the secret like an API key, store it somewhere safe, and rotate it if it leaks.
Prerequisites
#- A Knock account with at least one environment configured.
- An Amplitude project with access to Data > Catalog > Destinations.
- A paid Amplitude plan if you want to use Cohort Webhooks.
Set up the source in Knock
#Send events and users with Webhooks Streaming
#Use Amplitude's Webhook: Events · User Properties destination to stream product events, user property updates, or both. This destination sends data as Amplitude ingests it; it does not backfill events that Amplitude received before you enabled the destination.
An event payload includes fields such as event_type, user_id, event_properties, groups, and a unique uuid:
User payloads do not include event_type, so Knock normalizes them to $identify.
Sync cohorts with Cohort Webhooks
#Cohort Webhooks send batched membership changes to Knock. Knock maps entry batches to cohort.entered and exit batches to cohort.exited.
Amplitude supports three cohort sync behaviors:
Amplitude sends cohort updates in batches with a unique message_id:
Default action mappings
#The Amplitude template includes these mappings:
The cohort name can change in Amplitude, so Knock uses the stable cohort_id when it constructs the audience key. Cohort membership payloads must include Amplitude user_id values to map members to Knock users.
Align user identities
#Set Amplitude user_id to the same stable identifier you use as the Knock user ID. This keeps product events, user updates, cohort membership, and workflow recipients attached to the same Knock user. See Amplitude's user identity documentation for its identity model and user ID recommendations.
Amplitude can send an Identify payload with only a device_id. In that case, the default mapping creates or updates a Knock user keyed by that device ID. Knock does not merge that recipient with a later recipient keyed by Amplitude user_id, so use Amplitude user_id for signed-in users whenever possible.
Map product events to workflows
#Knock preserves the event_type for each streamed product event. After an event arrives, open the source's Mappings tab, select the event type, and create an action mapping.
For the Order Completed example above, you could configure a Trigger workflow action with these fields:
This triggers the selected workflow for the Amplitude user and makes properties such as order_id and total available in the workflow's templates. If your events can be device-only, choose a field that always resolves to a Knock user ID or normalize the recipient in the source preprocessing script.
Map Amplitude groups to objects or tenants
#Amplitude group types and Knock object collections are customer-defined. The Amplitude template does not assume that a group such as workspace, account, or project should become a particular object collection or tenant.
For an event with groups.workspace and group_properties.workspace, you can customize the Amplitude webhook payload to include the Knock collection name, then add a Set object mapping:
If your Amplitude group represents a Knock tenant instead, create a Set tenant mapping with body.groups.workspace as the tenant ID and body.group_properties.workspace as its properties. Adjust every path and collection name to match your Amplitude taxonomy and Knock data model.
Retries and idempotency
#Amplitude retries failed event and user deliveries nine times over four hours after the first attempt. It also retries 5xx and 429 responses within each attempt. Cohort Webhooks can retry timed-out batches, which can produce duplicate deliveries.
Knock configures idempotency for the Amplitude source using:
body.uuidfor streamed product events.body.message_idfor cohort batches.- A combination of the user or device ID and
body.event_timefor user updates.
Knock ignores a duplicate while its idempotency key remains in the source's idempotency window. You can change this behavior from the Settings tab. See source event idempotency for the window and key rules.
Debugging
#Open Platform > Sources, select the Amplitude source, and use its Logs tab to inspect received events and the actions they produced.
Common issues include:
- Verification failed. Confirm that Amplitude sends
Authorization: Bearer <your-signing-secret>and that the token matches the signing secret in the current Knock environment. - No events arrive. Confirm that the Amplitude destination is enabled and that the event matches its filters. Webhooks Streaming does not send events that Amplitude ingested before you enabled the destination.
- An action was skipped. Open the action log and check for a missing required field. Compare the mapping's dot-notation path with the received payload.
- Cohort members do not match users. Confirm that Amplitude
user_idvalues match Knock user IDs and that the cohort payload includes those IDs.
You can modify the default action mappings or add mappings for any Amplitude event type. For details on field paths, preprocessing, and available actions, see the custom source and sources overview.
