Integrations
Sources
Incoming webhooks
Clerk

How to connect Clerk to Knock

Learn how to use Clerk webhooks to trigger notifications and manage users in Knock.

The Clerk source enables you to receive Clerk webhook events in Knock and map them to actions like triggering workflows, identifying users, and managing tenants. Knock provides a pre-built integration with webhook verification and event-to-action mappings ready to use.

Prerequisites

#
  • A Clerk account with access to the Webhooks settings
  • A Knock account with at least one workflow configured

Getting started

#
1

Create the source in Knock

Navigate to Integrations > Sources in your Knock dashboard and click "Create source." Select Clerk from the list of pre-built integrations.

2

Copy the webhook URL

Copy the webhook URL for the Knock environment you want to configure.

3

Add the webhook endpoint in Clerk

In your Clerk Dashboard, go to Webhooks and click "Add Endpoint." Paste the Knock webhook URL and select the event types you want to subscribe to.

4

Copy the signing secret

After creating the endpoint in Clerk, copy the Signing Secret from the endpoint details page.

5

Paste the signing secret in Knock

Back in the Knock dashboard, paste the Clerk signing secret into the source configuration. Knock uses this to verify that incoming webhooks are from Clerk.

6

Review event mappings

Review the pre-configured event-to-action mappings and enable the ones relevant to your use case.

Pre-configured events

#

The Clerk source comes with mappings for common Clerk webhook event types. You can enable or disable each mapping independently.

Clerk eventSuggested actionDescription
user.createdIdentify userCreates a user in Knock when a new user signs up via Clerk
user.updatedIdentify userUpdates user properties in Knock when profile details change
user.deletedTrigger workflowNotifies relevant parties when a user account is deleted
session.createdTrigger workflowTriggers a workflow when a user starts a new session
organization.createdSet tenantCreates a tenant in Knock when a new Clerk organization is created
organization.updatedSet tenantUpdates tenant properties in Knock when organization details change
organizationMembership.createdSubscribe userSubscribes a user to a tenant when they join an organization
organizationMembership.deletedUnsubscribe userUnsubscribes a user from a tenant when they leave an organization

Customization

#

You can modify any of the pre-configured mappings or create new ones for additional Clerk event types. When customizing field mappings, use dot notation to reference nested fields in the Clerk webhook payload (e.g. data.email_addresses[0].email_address).

For details on building custom event-action mappings and field mapping, see the custom webhooks documentation.

New chat