Connect data
Connect PostHog to your AI client
To analyse your PostHog data in Claude, ChatGPT or another AI client, connect it to Bonnard on the Data page. Then give your team access to it. The agent can answer with charts, or with dashboards that have filters. Bonnard reads PostHog through a read-only grant to one project, so agents query only that project.
| Fact | PostHog |
|---|---|
| Credential | A read-only OAuth grant to one project |
| Scopes | query:read, event_definition:read, property_definition:read and openid |
| Region | PostHog Cloud, US or EU |
| Tenancy | None. Only your team members can get access |
Requirements
- The Editor role or higher in your Bonnard workspace.
- A PostHog Cloud project in the US or EU region, and a PostHog login that can open it. Bonnard does not work with self-hosted PostHog.
- A project that is not connected in this workspace.
1. Open PostHog from the Data page
In the console
In the console at app.bonnard.ai, select Data, then Add data source, then PostHog under Integrations. PostHog opens in the same
tab.
2. Approve access in PostHog
In the console
Sign in to PostHog. Select the organization and the project. Then approve access.
Bonnard asks to run read-only queries on that project, and to read its event and property definitions. These are the query:read, event_definition:read and property_definition:read scopes, plus openid.
PostHog asks for approval each time, and the grant covers that one project. PostHog then sends you back to Bonnard, which finds the project’s region and reads its tables.
Make sure that it is connected
In the console
Bonnard shows <project> is connected. On the data source’s page, Tables (N) shows the number of tables discovered. On Settings, the Connection card shows Connected and the project.
Only team members can get access to PostHog data, and there is no tenancy step.
If you deleted this project’s data source, Bonnard restores it when you connect the project again, with its dashboards and charts. Only admins can use it until you give access again.
Troubleshooting
Couldn't connect PostHog. You may have declined access, or the request expired.
This banner on the Data page means that Bonnard saved nothing. One of these is the cause:
- You declined access.
- You took over 10 minutes.
- You granted no project, or more than one.
- You selected a project that has a connection in this workspace.
- You changed Bonnard user or workspace before you approved access.
- PostHog failed or timed out.
Select Try again.
Could not connect PostHog
Bonnard cannot start the sign-in. Make sure that you have the Editor role or higher. Then select PostHog again.
Access expired
On Settings, the Connection card shows Access expired, and so does the data source’s card on the Data page. PostHog no longer accepts Bonnard’s access. For example, someone revoked it in PostHog, or selected Disconnect here. Unless someone selected Disconnect, admins get one email.
Select Reconnect. Then approve the same project. Another project fails.
This PostHog data source needs reconnecting. An admin or editor can reconnect it on the Data page.
Agents get this message until you reconnect. Select Reconnect. Then approve the same project.
Change or remove
In the console
On the data source’s Settings tab:
- Reconnect opens PostHog, where you approve the same project again. Unless access has expired, it is in the Connection actions menu.
- Re-scan tables, in the same menu, reads the table list now.
- Disconnect needs the Admin role. It revokes Bonnard’s access and keeps context and dashboards until you delete the data source.
- Delete data source needs the Admin role. Select Delete, then Delete data source. Bonnard loses its access to PostHog, and AI clients can no longer query the data source. Bonnard keeps the dashboards and charts built on it.
Charts in your AI client
- Give access to data: select the team members who can use it.
- Connect your AI client: add Bonnard to Claude, ChatGPT, Cursor or another MCP client.