PostHog: what this connector can do

Member·9 minutes to read

What this page is for

docs/connectors/posthog.md is the setup guide for whoever runs your organisation's Botseon deployment. This page is the other half: what PostHog lets a bot do once it is connected to your PostHog project, what you create at PostHog to connect it, what it asks you for along the way, its limits and errors, and how to take the connection away again, in Botseon and at PostHog.

Read events, run HogQL queries, and read insights, dashboards, feature flags, experiments, people, error tracking issues and annotations for a project; add annotations and create or switch feature flags after you approve.

What you create at PostHog

You connect PostHog with your own personal API key — there is no sign-in screen and nothing for an administrator to approve. Any member of a PostHog organisation can make one.

  1. Sign in to PostHog where you normally do — https://eu.posthog.com (EU) or https://us.posthog.com (US). That address is your region.
  2. Open your account settings (your avatar, then settings — not the project's settings) and go to Personal API keys, then + Create a personal API Key. Label it Botseon so you can find it again.
  3. Choose the scopes below, never "All access" (*), and limit the key to the one project you want a bot to use.
  4. Copy the key straight away: PostHog shows it once.

The Project API key (sometimes called the project token) on the project's own settings page is the wrong key. It sends events into PostHog and cannot read anything back out.

Connecting it in Botseon

  1. Open Plugins, find PostHog and press Add.
  2. In the plugin's settings, fill in PostHog region (eu or us) and PostHog project id (the number in your project's address, for example 12345). The key is checked against both, so Botseon asks for them first.
  3. Under Accounts, paste the key and tick the scopes you gave it at PostHog. feature_flag:read is required: it is what Botseon reads to check the key works.
  4. Press Connect. Botseon makes one read at PostHog with the key — the project's feature flags, one row — and stores the key, encrypted, only if PostHog accepts it.

What a bot can do with it

Read — PostHog tells a bot things, nothing changes

ToolWhat it does
posthog.list_eventsList recent product events for a project, newest first, optionally one event name and only after a time.
posthog.run_queryRun a HogQL query against the project and return its columns and rows (at most 500).
posthog.list_insightsList the project's saved insights — names and descriptions, not their results.
posthog.get_insightRead one saved insight and its latest result.
posthog.list_dashboardsList the project's dashboards.
posthog.list_feature_flagsList the project's feature flags: key, name, on or off, archived.
posthog.get_feature_flagRead one feature flag with its release conditions and their rollout percentages.
posthog.list_personsList the people the project has recorded, searchable by email, name or distinct id.
posthog.list_experimentsList the project's experiments, optionally by status (running, draft, …).
posthog.list_error_issuesList the project's error tracking issues with their status and severity.
posthog.list_annotationsList the project's annotations.

Write — PostHog lets a bot change things

ToolWhat it does
posthog.create_annotationAdd an annotation — a note at a point in time — to the project's charts.
posthog.create_feature_flagCreate a feature flag with a key and a rollout percentage. It starts off unless you ask for it on.
posthog.update_feature_flagSwitch a flag on or off, rename it, or change the rollout of a flag that has one release condition.

No tool deletes anything at PostHog.

The permissions it asks for, in plain words

Every call a bot makes through this connector is tagged with what kind of thing it is. Only the tags below ever apply here — a tag this connector's tools never carry is not listed, because it can never ask you for it.

  • read — Looks something up. Nothing changes, and nothing is sent anywhere. A bot never has to ask first for this.
  • write — Changes something inside the connected account — creates, edits or files something. Asks you first, unless you have told Botseon to always allow that exact action.

The PostHog scopes, and what each one unlocks

PostHog names its permissions per resource. These are the ones to tick at PostHog and again in Botseon:

ScopeLets a bot
query:readlist events and run HogQL queries
insight:readlist and read saved insights
dashboard:readlist dashboards
feature_flag:readlist and read feature flags — required, Botseon's key check uses it
person:readlist people
experiment:readlist experiments
error_tracking:readlist error tracking issues
annotation:readlist annotations
annotation:writeadd annotations
feature_flag:writecreate feature flags and switch or change them

The read tools are offered once every read scope is ticked; the write tools once both write scopes are. A key created read-only gets no write tool at all. If you tick a scope the key does not really carry, the first tool that needs it is shown as Disabled with PostHog's reason and the rest keep working; add the scope at PostHog, then press I updated the key on the account.

Limits

Only the tools above. Nothing outside that list is possible through this connector, however a bot is asked to use it. Each account reaches one region and one project — the two values in the plugin's settings — whatever else the key could reach.

  • A query returns at most 500 rows to the bot, and PostHog stops any query after 10 seconds.
  • PostHog's own limits: 2,400 query calls an hour for the project (240 a minute, three at once), 240 analytics reads a minute, 480 other reads and writes a minute. A busy project may see a short pause.
  • A rollout change is refused for a flag with more than one release condition — change those in PostHog, where you can see which condition you mean.

Errors you may see

What Botseon saysWhat it meansWhat to do
PostHog region is required — this plugin exposes no tools until it is filled in.The key is checked against your region, and it is not set, or is not eu or usFill in the region in this plugin's settings, then connect
PostHog project id is required — this plugin exposes no tools until it is filled in.The project id is not set, or is not the number PostHog showsFill in the project id in this plugin's settings, then connect
The provider refused that key. Check it was created with feature_flag:read and try again.PostHog did not accept the key for that region and projectCheck the region first (a key from the other region is unknown there), then the project id, then that the key has feature_flag:read
Disabled: …, beside one toolThe key lacks that tool's PostHog scope or this projectAdd the scope at PostHog, then I updated the key
A bot reports PostHog is rate-limiting this keyOne of the limits aboveWait a minute and ask again; Botseon waits as long as PostHog says to
A bot reports PostHog could not find that resourceNo such insight, flag or projectCheck the id

Disconnecting

In Botseon

Open Plugins from the sidebar, press this connector's card to open its detail page, and under Accounts press Disconnect to delete the stored key and keep the account, or the ✕ next to it (labelled "Remove account" and the account's name) to delete the account too — or Uninstall to remove the plugin and every account connected to it at once. Each one deletes the stored key immediately: no PostHog tool is offered for the account from that moment on. Install a plugin walks through the same screen step by step.

At PostHog

Removing the account in Botseon deletes the stored key from Botseon, but the key itself stays valid at PostHog until you revoke it there — Botseon has no way to revoke a key it did not issue. In your PostHog account settings, under Personal API keys (the same place you created it), delete the key, or open it and use Roll key, which invalidates the old value at once.

What Botseon keeps, and how your data is used

Whatever a bot reads or writes through this connector becomes part of your conversations and the record of that run — the same records, and the same retention schedule, as everything else a bot works on. Botseon is the processor for that content; your organisation decides what it may read and remember, and can delete it sooner than the schedule would on its own.

Your data is sent to a model provider only to produce the bot's answer, and for nothing else — it is not used to train any model. The Privacy Policy's Models and How long we keep it sections have the full detail, including exactly how long each kind of record is kept for.

With the region set to eu, this connector calls only PostHog Cloud EU (https://eu.posthog.com).

See also

Last verified against build ad93750.