Linking Knock as a source

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

Learn more
PostHog Wizard hedgehog

Contents

Alpha release

This source is currently in alpha. The interface and available tables may change.

The Knock connector syncs your notification data – messages, users, tenants, objects, schedules, workflow recipient runs, message events, and delivery attempts – into PostHog, so you can analyze notification delivery and engagement alongside your product data.

Prerequisites

You need a Knock account with access to the secret API key for the environment you want to import from. Knock API keys are scoped to a single environment (like development or production), so pick the key for the environment whose data you want.

Adding a data source

  1. In PostHog, go to the Sources tab of the data pipeline section.
  2. Click + New source and click Link next to this source.
  3. Enter your credentials (see Configuration below) and click Next.
  4. Select the tables you want to sync, choose a sync method and frequency, then click Import.

Once the syncs are complete, you can start querying this data in PostHog.

You need your Knock secret API key (it starts with sk_). Find it in the Knock dashboard under Developers → API keys. Public keys (pk_) only support client-side identification and won't work for syncing data.

Sync modes

Each table can be synced in one of several modes, depending on what the source supports:

  • Webhook (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
  • Incremental – only new or updated rows are synced on each run, using a cursor field (such as an updated_at timestamp). Cheaper than a full refresh, but deletes aren't captured.
  • Append only – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
  • Full refresh – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.

See sync methods for a full explanation of how each mode works and how to choose between them.

The messages and workflow_recipient_runs tables support incremental sync on inserted_at using Knock's server-side date filters, so ongoing syncs only fetch new rows. Engagement fields that change on existing messages after delivery (like read_at, seen_at, and interacted_at) are only refreshed by a full refresh, so consider scheduling periodic full refreshes of messages if you rely on those fields.

The users and tenants tables don't have a server-side updated-since filter in Knock's API, so they always sync as a full refresh.

The objects table syncs object recipients from the collections you specify in the Object collections configuration field. Since Knock has no endpoint to list collections, you must enter your collection names manually. This table only syncs when at least one collection is configured.

The schedules table fetches schedules per user and syncs as a full refresh. It is off by default because it sends one request per user – enable it in the sync settings if you need schedule data.

The message_events and message_delivery_logs tables capture what happens to each message after it was sent. message_events includes state changes like sent, delivered, read, and link clicked. message_delivery_logs includes the provider request and response for each delivery attempt. Both tables use the parent messages listing with a backfill window (three days for events, one day for delivery attempts) to pick up events that land after a message is created. These tables are off by default because they send one request per message – enable them in the sync settings if you need this data.

Knock also excludes messages outside your account's retention window from its API, so the messages table only backfills as far as your Knock retention allows.

Configuration

OptionDescription
Secret API key
Type: password
Required: True
Object collections
Type: text
Required: False

Comma-separated object collection keys to sync into the objects table. Knock can't list collections, so the objects table only syncs the collections you enter here.

Object collections: Knock has no API endpoint to list your collections, so you must manually enter the collection names (comma-separated) you want to sync. You can find your collection names in the Knock dashboard under Objects. Leave this field empty if you don't use objects as notification recipients.

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
messages

A notification delivered (or attempted) to a single recipient on a specific channel, with delivery and engagement status.

Incremental, Full refreshinserted_at—
users

A recipient identified to Knock, with the profile properties used to notify them.

Full refresh——
tenants

A tenant used to scope notifications, preferences, and branding to a group of users (typically one of your customers).

Full refresh——
workflow_recipient_runs

An individual execution of a workflow for a specific recipient, with its trigger source and status.

Incremental, Full refreshinserted_at—
objects

A non-user recipient (such as an account, project, or device) stored in a collection you configure on the source.

Full refresh——
schedules

A recurring or one-off workflow execution scheduled for a user recipient.

Full refresh——
message_events

A status change recorded on a message, such as sent, delivered, read, or link clicked.

Incremental, Full refreshmessage_inserted_at—
message_delivery_logs

The request sent to a channel provider and the response it returned for one delivery attempt of a message.

Incremental, Full refreshmessage_inserted_at—

Troubleshooting

If the source fails to connect or a sync stops with an authorization error, your secret API key is likely invalid or revoked – generate a new key in the Knock dashboard under Developers → API keys and update the source credentials. If a table is unexpectedly empty, check that you connected the key for the right Knock environment, since each key only sees its own environment's data.

If the objects table is empty, check that you have entered your object collection names in the Object collections configuration field. If the message_events, message_delivery_logs, or schedules tables are empty, verify they are enabled in your sync settings – these tables are off by default to avoid high API usage.

If your sync is failing or data looks wrong, see the Data warehouse troubleshooting guide. If that doesn't help, contact support – we're happy to help.

Still have questions?

Was this page useful?