Linking Knock as a source

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, and workflow recipient runs – 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 DevelopersAPI 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.

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

OptionTypeRequired
Secret API keypasswordYes

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

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 DevelopersAPI 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 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.

Community questions

Was this page useful?