Connect PostHog to Fondoo
This connection lets Fondoo and your AI agent read recent product analytics events from one PostHog project. The agent can check what users did on your site or app (page views, sign-ups and other tracked events) in a time window you choose. It is read-only and works with PostHog US Cloud only.
What Fondoo can do with it
The connector id is posthog. It has one capability:
events.list(read): lists raw events from your project. It callsGET https://us.posthog.com/api/projects/{projectId}/events/and passes through three optional inputs:afterandbefore(ISO date-times) andlimit(how many events). If you leave outafter, PostHog defaults to the last 24 hours.
There are no write actions, so nothing needs owner approval. Agents without the owner scope need the analytics:read scope.
Important limits of this connector:
- US Cloud only. The address
https://us.posthog.comis fixed in the code. EU Cloud (eu.posthog.com) and self-hosted PostHog are not supported by this module. An EU or self-hosted key will fail the connection test. - PostHog has deprecated this endpoint. PostHog's API schema says the events list "is effectively deprecated and is kept only for backwards compatibility", and recommends its Query endpoint or batch exports instead. It still works today, but it may change or be removed by PostHog. This may differ for your account.
Before you start
- A PostHog account on US Cloud (your address bar shows
us.posthog.com). PostHog has a free tier; reading data through the API does not add cost. See PostHog pricing. - The project you want to read, with events already being captured.
- Your Fondoo site id, if you want the connection tied to one site.
Step by step: get your credentials
You need two values: a personal API key (secret) and your project id (not secret). The project API key that starts with phc_ is for sending events, not reading them, so it will not work here.
Personal API key
- In PostHog, open your account settings and go to Personal API keys (direct link for US Cloud).
- Click + Create a personal API Key.
- Give it a label, for example
Fondoo read. - Limit the key to the organization or project you are connecting, if PostHog offers that choice.
- Choose scopes. Tick read access only:
- Query: Read (
query:read). PostHog's API schema lists this as the scope for the events list. - Project: Read (
project:read). Fondoo's connection test callsGET /api/projects/, which needs project read access. Do not grant write scopes. PostHog recommends picking only the scopes you need (personal API keys). Exact scope labels may differ for your account.
- Query: Read (
- Create the key and copy it straight away. PostHog shows it only once. It normally starts with
phx_. - This value goes in the
apiKeyfield.
Project id
- Open the project in PostHog. The project id is the number in the address bar after
/project/, for example12345inus.posthog.com/project/12345/.... You can also look for Project ID in the project settings. - This value goes in the
projectIdfield. It is required.
Connect it in Fondoo
In the dashboard
- Go to Connections in the sidebar and click Connect a tool.
- In Find a tool, type
PostHog. - On the PostHog card, click Use a key. When "Enter your key securely" appears, click Open secure key entry.
- On the "Connect posthog" page, fill in
apiKey(a hidden password field) andprojectId. Click Save connection securely. The page works once and expires after 15 minutes. - The connection shows under Connected with a masked key. Click Check connection.
By asking your agent
Example prompt: "Connect our PostHog project so you can read events. Give me a secure link for the key."
The agent calls:
add_connection_key({ provider: "posthog", siteId: "YOUR-SITE-ID" })It returns a one-use securePasteUrl (15 minutes). Open it and enter both fields there. Passing the key in fields also works, but Fondoo warns that it may remain in chat logs. connect_service({ provider: "posthog", siteId }) returns the same steps with a signed link and never accepts a key.
REST equivalent:
curl -X POST https://api.getfondoo.com/v1/ops/add_connection_key \
-H "Authorization: Bearer $FONDOO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"provider":"posthog","siteId":"YOUR-SITE-ID"}'Test that it works
- Click Check connection, or ask the agent to run
test_connection({ connectionId }). Fondoo callsGET https://us.posthog.com/api/projects/once. A pass showsconnectedand "Cheap read succeeded; untested permissions remain unknown, not granted."events.listshows asunknownbecause the test does not check the project id or the query scope. - Ask the agent: "Show me the last 10 PostHog events." It runs:
connector_action({ connectionId, action: "events.list", input: { limit: 10 } })If events come back, the project id and scopes are right.
Troubleshooting
- "Connection test failed; check credentials and provider permissions." The key is wrong, revoked, from EU Cloud or self-hosted, or lacks project read. Create a US Cloud personal key with the scopes above and rotate.
- Test passes but
events.listis refused. The key is missingquery:read, or it is not allowed to access this project. Edit the key's scopes in PostHog (scopes can be changed later) and try again. - "Provider request failed (404)". The
projectIdis wrong or belongs to another organization. Copy the number from the address bar again and rotate the connection. - "Credential fields do not match the connector manifest." Both
apiKeyandprojectIdare required, and no other fields are accepted. - Empty results. By default PostHog returns only the last 24 hours. Pass a wider
after, for example{ "after": "2026-10-01T00:00:00Z", "limit": 100 }. - Rate limit errors. Wait and retry. See below.
Limits, data and security
- PostHog limits: most private API rate limits apply per personal API key. PostHog publishes, for example, 240 requests per minute and 1,200 per hour for analytics endpoints, and 480 per minute and 4,800 per hour for other read endpoints. Which bucket the events list falls into may differ for your account. See PostHog API overview.
- Fondoo limit: a local budget of 60 requests per minute per connection. PostHog's limits and
Retry-Afterstay authoritative. - Responses larger than 4 MB are rejected, so keep
limitmodest. - What Fondoo stores: the key and project id, encrypted in Fondoo's connector vault.
list_connectionsshows only masked values. Event results are returned to the caller. - Rotate:
rotate_connection_key({ connectionId })returns a new secure paste link and replaces the stored values. You can setexpiresAtorrotateAfterto get reminders. - Disconnect:
delete_connection({ connectionId })(agents need owner approval). It does not revoke the key in PostHog, so also delete or roll the key under Personal API keys.
Official links
- API overview, regions and rate limits: https://posthog.com/docs/api
- Personal API keys: https://posthog.com/docs/api/personal-api-keys
- Events API reference: https://posthog.com/docs/api/events
- Query API: https://posthog.com/docs/api/queries
- API schema (lists scopes and the deprecation note): https://us.posthog.com/api/schema/
- Pricing: https://posthog.com/pricing
