PostHog
Arcade toolkit · docs.arcade.dev
PostHog is a product analytics and experimentation platform. The Arcade PostHog toolkit lets agents query analytics, manage experiments, and curate insights directly from a PostHog project.
Capabilities
- Build and manage dashboards, insights, funnels, trends, and retention views.
- Create and iterate on experiments, feature flags, and surveys with full CRUD support.
- Inspect event and property definitions, investigate errors, and compare time periods.
- Run ad-hoc HogQL or insight queries and retrieve results for downstream analysis.
OAuth
No OAuth — authentication uses a PostHog personal API key passed as a secret.
Secrets
POSTHOG_PERSONAL_API_KEY— PostHog personal API key created under Account Settings → Personal API Keys.POSTHOG_SERVER_URL— target PostHog region or self-hosted instance URL (e.g.https://us.posthog.com).
Configure both in the Arcade Dashboard per the Arcade secret setup guide.
Tools41
Posthog_AddInsightToDashboard
Pin an existing insight as a tile on a dashboard.
Posthog_ComparePeriods
Compare the same metric across two date ranges side-by-side.
Posthog_CreateDashboard
Create a new empty dashboard. Insights can be pinned to it as tiles afterward.
Posthog_CreateExperiment
Create an A/B test experiment. Before creating, verify the feature_flag_key is not already in use and confirm the event names for metrics are valid. Note: PostHog does not enforce unique feature_flag_key values across experiments. Duplicate keys will not error but will cause unpredictable behavior.
Posthog_CreateExperimentWithFlag
Create a feature flag and an experiment in one step. The flag is created with the specified rollout_percentage, then the experiment is linked to it. Note: PostHog does not enforce unique feature_flag_key values across experiments. Duplicate keys will not error but will cause unpredictable behavior.
Posthog_CreateFeatureFlag
Create a new feature flag. Verify the key is not already in use to avoid duplicates. After creation, consult PostHog SDK documentation for the user's language/framework to integrate the flag.
Posthog_CreateInsightFromQuery
Save a tested query as a reusable insight. Always verify the query produces expected results before saving it as an insight. The query_id is not validated by PostHog — ensure it is a valid cache_key from a previously executed query. Passing an invalid query_id will create a broken insight.
Posthog_CreateSurvey
Create a new survey. Verify the name is not already in use to avoid duplicates. After creation, consult PostHog SDK documentation to integrate the survey into the user's application.
Posthog_DeleteDashboard
Soft-delete a dashboard by ID. The dashboard is marked as deleted but can be restored.
Posthog_DeleteExperiment
Soft-delete an experiment by ID (marks as archived). Important: archiving an experiment does NOT unlink its feature flag. PostHog still considers the flag as linked to an "active" experiment, blocking flag deletion. To fully clean up, delete the flag separately after the experiment is archived.
Posthog_DeleteFeatureFlag
Soft-delete a feature flag by numeric ID or key. Provide one of flag_id or flag_key. Note: flags linked to an experiment cannot be deleted until the experiment is concluded and deleted first. PostHog considers even archived experiments as "active" for flag linkage purposes.
Posthog_DeleteInsight
Soft-delete an insight by ID.
Posthog_DeleteSurvey
Soft-delete a survey by ID (marks as archived).
Posthog_GetAllSurveyActivity
Get the activity log across all surveys. Returns a chronological list of changes made to any survey (created, updated, archived, etc.), not response metrics.
Posthog_GetDashboard
Get a dashboard's full configuration including all insight tiles. Provide dashboard_id or dashboard_name.
Posthog_GetErrorDetails
Get stack trace, occurrence count, and affected users/sessions for a specific error.
Posthog_GetExperiment
Get an experiment's full configuration. Includes variants, metrics, and current status. Provide either the numeric ID or the name.
Posthog_GetExperimentResults
Get experiment results including metric data and exposure counts. Only available for launched experiments that have collected data. Draft, not-yet-launched, or legacy experiments return 404.
Posthog_GetFeatureFlag
Get a feature flag's full definition including rollout rules. Provide either the numeric ID or the flag key.
Posthog_GetFunnel
Build a multi-step conversion funnel with optional property breakdowns.
Posthog_GetInsight
Get an insight's full configuration and current query results. Provide either the numeric ID or the name.
Posthog_GetRetention
Get cohort retention data showing what percentage of users return. Shows return rates after a user's initial event.
Posthog_GetSurvey
Get a survey's full configuration. Includes questions, targeting rules, and scheduling. Provide either the numeric ID or the name.
Posthog_GetSurveyActivity
Get the activity log for a survey. Returns a chronological list of changes made to the survey (created, updated, archived, etc.), not response metrics.
Posthog_GetTrend
Get a time-series trend for an event over a date range. Optionally broken down by a property.
Posthog_GetTrends
Batch trend query: get time-series data for multiple events. Returns a time-series for each event. Unknown event names return zero counts rather than errors.
Posthog_ListDashboards
List all dashboards in the project. Returns summaries (id, name, pinned, tags, created_at). Use a dashboard's ID to get its full configuration and insight tiles.
Posthog_ListErrors
List error tracking issues. Returns summaries (id, fingerprint, status, occurrences, users, first_seen, last_seen). Use an error's fingerprint to fetch its full stack trace.
Posthog_ListEventDefinitions
List all tracked event names in the project. This is the discovery starting point -- use it to find valid event names, then look up an event's properties to discover available filters and breakdowns.
Posthog_ListExperiments
List all A/B test experiments. Returns summaries (id, name, feature_flag_key, start_date, end_date). Use an experiment's ID or name to get its full configuration.
Posthog_ListFeatureFlags
List all feature flags. Returns summaries (id, key, name, active). Use a flag's ID or key to get its full rollout rules and targeting detail.
Posthog_ListInsights
List all saved insights. Returns summaries (id, name, description, last_modified_at). Use an insight's ID or name to get its full configuration and query results.
Posthog_ListProperties
List property definitions with names, types, and example values. Use this as a schema exploration step: after identifying tracked event names, query with event_name to discover its properties for use in filters and breakdowns.
Posthog_ListSurveys
List all surveys. Returns summaries (id, name, type, created_at). Use a survey's ID or name to get its full configuration.
Posthog_RunQuery
Execute a raw PostHog query. For common analytics patterns (trends, funnels, retention), prefer purpose-built tools if available. Use this for custom query shapes. Discover valid event names before constructing a query. For the full query schema and supported kinds, see https://posthog.com/docs/api/queries
Posthog_UpdateDashboard
Update a dashboard's name, description, pinned status, or tags. Review the dashboard's current values before updating.
Posthog_UpdateExperiment
Update an experiment's properties or lifecycle state. Review the experiment's current state before updating. To launch: set launch=true. To conclude: set conclude='winning_variant_name'. To restart: set restart=true.
Posthog_UpdateFeatureFlag
Update a feature flag's properties or rollout rules. Provide one of flag_id or flag_key. Review the flag's current state before updating. To enable: set active=true and rollout_percentage=100. To disable: set active=false.
Posthog_UpdateInsight
Update an insight's name, description, or query filters. Review the insight's current query structure first and only modify the parts you need to change.
Posthog_UpdateSurvey
Update a survey's name, description, or questions. Review the survey's current configuration before updating.
Posthog_WhoAmI
Return the authenticated user's identity, organizations, and projects. Call this first to confirm credentials and discover available organization and project IDs.