Linking Hasura 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.

The Hasura connector syncs the tables and views exposed by your Hasura GraphQL Engine into the PostHog data warehouse, so you can query them alongside your product data. PostHog discovers your tables and views with a GraphQL introspection query against the Hasura GraphQL API.
It works with both Hasura Cloud and self-hosted Hasura v2.
Prerequisites
You need:
- Your Hasura GraphQL endpoint, e.g.
https://my-project.hasura.app/v1/graphql. It must use HTTPS and be reachable from the public internet. - Your Hasura admin secret (the
HASURA_GRAPHQL_ADMIN_SECRETvalue).
On Hasura Cloud, you can find both on your project's General settings page.
Adding a data source
- In PostHog, go to the Sources tab of the data pipeline section.
- Click + New source and click Link next to this source.
- Enter your credentials (see Configuration below) and click Next.
- 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.
When linking Hasura, provide:
- GraphQL endpoint - Your Hasura GraphQL endpoint URL.
- Admin secret - Your Hasura admin secret. PostHog sends it in the
x-hasura-admin-secretheader.
PostHog checks the endpoint before connecting:
- Plain
http://URLs are rejected. If you leave out the scheme, PostHog addshttps://. - If you enter only the project URL with no path (e.g.
https://my-project.hasura.app), PostHog appends/v1/graphql. - The URL can't contain a user name or password.
- Localhost, private IP addresses, internal domains, and cloud metadata hosts are rejected.
- Redirects aren't followed.
If you change the endpoint on an existing source, you need to re-enter the admin secret.
PostHog reads with the admin role, so it sees every table Hasura tracks.
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_attimestamp). 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.
Tables with a primary key support incremental and append-only syncs on a timestamp, date, or integer column. Supported Hasura scalar types are timestamptz, timestamp, date, datetimeoffset, datetime2, Int, bigint, and smallint. Each page is ordered by the incremental column, so pick a column with a database index.
The following sync with a full refresh only:
- Views
- Tables without a primary key
- Tables whose primary key includes a column that references a Hasura enum table
Array (list) columns are synced, but you can't use them as the incremental column.
Configuration
| Option | Type | Required |
|---|---|---|
GraphQL endpoint | text | Yes |
Admin secret | password | Yes |
Supported tables
The tables available from this source are discovered from your account when you connect it, so the exact list depends on your data. Once connected, you can pick which tables to sync from the sources tab.
Limitations
- Only Hasura sources using the
hasura-defaultnaming convention are supported. Thegraphql-defaultnaming convention isn't supported. - Sources that put their root fields under a namespace aren't supported.
- A single response larger than 256 MB fails. This can happen with very wide rows.
- Tables with no primary key and no orderable column can't be synced.
Troubleshooting
- Hasura rejected the admin secret - Check the admin secret on your Hasura project, then reconnect.
- Your Hasura endpoint refused the request - This HTTP 403 comes from a proxy, firewall, or IP allowlist in front of Hasura, not from Hasura itself. Allow requests from PostHog.
- Your Hasura source uses the graphql-default naming convention - Switch the source to the
hasura-defaultnaming convention. - Your Hasura source puts its root fields under a namespace - Remove the namespace in Hasura.
- Hasura doesn't expose this table right now - PostHog retries this first. If it persists, check that the table is tracked in Hasura and that your Hasura metadata is consistent.
- Your database stopped a query on its statement timeout - Views, tables without a primary key, and incremental columns without an index get slower the deeper the sync goes. Add a primary key or index, or raise the statement timeout.
- This table can no longer sync incrementally on the chosen column - Pick another incremental column or switch to full refresh.
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.





