> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Linking Knock as a source Canonical URL: https://posthog.com/docs/data-pipelines/sources/knock > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://us.posthog.com` or `https://app.posthog.com` (app host for links). ## On this page - [Prerequisites](#prerequisites) - [Adding a data source](#adding-a-data-source) - [Sync modes](#sync-modes) - [Configuration](#configuration) - [Supported tables](#supported-tables) - [Troubleshooting](#troubleshooting) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70) ![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d) 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. `npx @posthog/wizard warehouse` ![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png) ![](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)Let AI connect your sources for you 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](https://app.posthog.com/data-management/sources) of the data pipeline section. 2. Click **\+ New source** and click **Link** next to this source. 3. Enter your credentials (see [Configuration](#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](https://posthog.com/docs/data-pipelines/sources.md#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 | Option | Description | | --- | --- | | `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. | | `Audience keys` **Type:** text **Required:** False | Comma-separated audience keys to sync into the `audience_members` table. Knock can't list audiences, so the `audience_members` table only syncs the audiences 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 | Table | Description | Sync method | Incremental field | Primary key | | --- | --- | --- | --- | --- | | `messages` | A notification delivered (or attempted) to a single recipient on a specific channel, with delivery and engagement status. | Incremental, Full refresh | inserted\_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 refresh | inserted\_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 refresh | message\_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 refresh | message\_inserted\_at | — | | `message_activities` | A workflow trigger that produced a message, with the actor, recipient, and trigger data. A batched message has one activity for each trigger in the batch. | Incremental, Full refresh | message\_inserted\_at | — | | `user_subscriptions` | A subscription of a user to an object. Workflows triggered for the object notify its subscribers. | Full refresh | — | — | | `user_preferences` | A set of notification preferences of a user. A user has a default preference set and can have one per tenant. | Full refresh | — | — | | `audience_members` | A user who is a member of an audience. A user can be a member once for each tenant. | Full refresh | — | — | ## 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](https://posthog.com/docs/data-warehouse/troubleshooting.md). If that doesn't help, [contact support](https://us.posthog.com/#panel=support%3Asupport%3Adata_warehouse%3A%3Atrue) – we're happy to help.