Shipfox

PostHog tools

Look up PostHog's read-only tools, selectors, inputs, and examples for agent steps and tool steps.

This reference lists the shipped PostHog tool catalog. See the PostHog overview for authentication and project boundaries.

Tool catalog

All tools require the read access configured in the personal API key recipe.

Tools

Execute a read-only HogQL query against PostHog data.

RequiresreadSensitive

Parameters

connectionIdstring

Optional id of a data warehouse connection (e.g. Postgres, MySQL, Snowflake, Redshift). When set, the query runs live against that source instead of the ClickHouse catalog, and may only reference that source's tables. Discover connection ids with external-data-sources-connections-list, then list a connection's tables by running `SELECT table_name FROM system.information_schema.tables` with that connectionId set.

querystringRequired

The final SQL query to be executed.

Minimum length 1.

sendRawQueryboolean

Send `query` to the connection verbatim instead of compiling it from HogQL first. Use this for SQL only that connection's own engine understands, such as vendor-specific functions. Requires connectionId, and works only on a pure direct connection (access_method 'direct'), not on a synced source with live queries enabled. The connection is read-only and accepts a single statement.

truncateboolean

Whether to truncate large blob/JSON values in results. Defaults to true. Set to false when you need full untruncated results (e.g., for dumping to a file).

Default true.

Read the available PostHog event, entity, and property schema.

Requiresread

Parameters

queryobject (one of 7 shapes)Required

The data schema query to execute.

Show 7 attributes
kindconstant "events" | constant "event_properties" | constant "entity_properties" | constant "action_properties" | constant "entity_property_values" | constant "event_property_values" | constant "action_property_values"Conditional
limitintegerConditional

Number of events to return per page.

Minimum 1. Maximum 500. Default 500.

offsetintegerConditional

Number of events to skip for pagination.

Minimum 0. Maximum 9,007,199,254,740,991. Default 0.

event_namestringConditional

The name of the event that you want to retrieve properties for.

entitystringConditional

The entity to read: `person`, `session` for the columns of the `sessions` table, or a group type name. The plural form of any of these is accepted too.

action_idintegerConditional

The ID of the action that you want to retrieve properties for.

Minimum -9,007,199,254,740,991. Maximum 9,007,199,254,740,991.

property_namestringConditional

Verified property name of an entity.

List saved insights in the current PostHog project.

Requiresread

Parameters

created_bystring

JSON-encoded array of user IDs. Only returns insights whose `created_by` is in the list, e.g. `[1,42]`.

created_date_fromstring

Filter by `created_at > created_date_from`. Accepts absolute or relative dates.

created_date_tostring

Filter by `created_at < created_date_to`. Accepts absolute or relative dates.

dashboardsstring

JSON-encoded array of dashboard IDs. Returns insights attached to every listed dashboard (AND).

date_fromstring

Filter by `last_modified_at > date_from`. Accepts absolute dates (`2025-04-23`) or relative strings (`-7d`, `-1m`).

date_tostring

Filter by `last_modified_at < date_to`. Accepts absolute dates or relative strings.

favoritedboolean

Include this parameter (any value) to restrict results to insights marked as favorited.

include_dashboardsboolean

Opt in to receiving the deprecated `dashboards` field in insight payloads. Once opt-in enforcement is enabled, API-token callers stop receiving it by default; use `dashboard_tiles` instead.

insightstring

Restrict to a single insight type. `JSON` matches non-wrapper query insights; `SQL` matches HogQL queries.

Possible values: FUNNELS, JOURNEYS, JSON, LIFECYCLE, PATHS, RETENTION, SQL, STICKINESS, TRENDS

last_viewed_date_fromstring

Filter by `last_viewed_at > last_viewed_date_from`. Accepts absolute or relative dates.

last_viewed_date_tostring

Filter by `last_viewed_at < last_viewed_date_to`. Accepts absolute or relative dates.

limitnumber

Number of results to return per page.

offsetnumber

The initial index from which to return the results.

savedboolean

When truthy, restricts results to insights that are saved (or attached to a visible dashboard). When falsy, only unsaved insights.

searchstring

Search term matched across name, derived_name, description, and tag names. Returns exact (case-insensitive substring) matches only; if no exact match exists, returns similar (fuzzy trigram) matches instead. Each result's `search_match_type` is `exact` or `similar`.

short_idstring
tagsstring

JSON-encoded array of tag names. Returns insights with any of the listed tags.

userboolean

Include this parameter (any value) to restrict results to insights created by the authenticated user.

Retrieve a saved insight definition by numeric id or short id.

Requiresread

Parameters

filters_overridestring | object

Object (or pre-encoded JSON string) to override the insight's filters for this request only (not persisted). Top-level keys replace; nested values are not deep-merged: pass the complete value for any key you override. Accepts the same keys as the dashboard filters schema (e.g., `date_from`, `date_to`, `properties`). Ignored when accessed via a sharing token.

idnumber | stringRequired

Numeric primary key or 8-character `short_id` (for example `AaVQ8Ijw`) identifying the insight.

include_dashboardsboolean

Opt in to receiving the deprecated `dashboards` field in insight payloads. Once opt-in enforcement is enabled, API-token callers stop receiving it by default; use `dashboard_tiles` instead.

variables_overridestring | object

Object (or pre-encoded JSON string) to override the insight's HogQL variables for this request only (not persisted). Format: {"<variable_id>": {"code_name": "<code_name>", "variableId": "<variable_id>", "value": <new_value>}}. Each entry must include `code_name`: partial entries are silently dropped. The simplest workflow is to call `insight-get` first, copy the matching entry from the response, and mutate `value`. Top-level keys replace; nested values are not deep-merged. Ignored when accessed via a sharing token.

Run a saved insight and return its query results.

RequiresreadSensitive

Parameters

filters_overridestring | object

Object (or pre-encoded JSON string) to override the insight's filters for this run only (not persisted). Top-level keys replace; nested values are not deep-merged: pass the complete value for any key you override. Accepts the same keys as the dashboard filters schema (e.g., `date_from`, `date_to`, `properties`). Ignored when accessed via a sharing token.

insightIdstring | numberRequired

The insight to run: its numeric `id` or 8-character `short_id`.

output_formatstring

Output format. "optimized" returns a human-readable summary from server-side formatters (recommended for analysis). "json" returns the raw query results as JSON.

Possible values: optimized, json

Default "optimized".

variables_overridestring | object

Object (or pre-encoded JSON string) to override the insight's HogQL variables for this run only (not persisted). Format: {"<variable_id>": {"code_name": "<code_name>", "variableId": "<variable_id>", "value": <new_value>}}. Each entry must include `code_name`: partial entries are silently dropped. The simplest workflow is to call `insight-get` first, copy the matching entry from the response's query variables, and mutate `value`. Top-level keys replace; nested values are not deep-merged. Ignored when accessed via a sharing token.

List dashboards in the current PostHog project.

Requiresread

Parameters

exclude_generatedboolean

Optional. Exclude dashboards that PostHog generated.

folderstring

Optional. Return only dashboards filed directly in this project-tree folder, e.g. 'Unfiled/Dashboards'. An empty string matches dashboards at the project root. Nested sub-folders are not included.

limitnumber

Number of results to return per page.

offsetnumber

The initial index from which to return the results.

pinnedboolean

Optional. Return only pinned dashboards.

searchstring

Optional. Match against dashboard `name`, `description`, and tag names. Returns exact (case-insensitive substring) matches only; if no exact match exists, returns similar (fuzzy trigram: typos, transpositions, prefix-as-you-type) matches instead. Results are then ordered by relevance, then pinned status, then name; each result's `search_match_type` is `exact` or `similar`. When omitted, dashboards are ordered by pinned status then alphabetical name. Capped at 200 characters; longer queries return a 400 error.

Retrieve a dashboard and its tiles by id.

Requiresread

Parameters

filters_overridestring | object

Object (or pre-encoded JSON string) to override dashboard filters for this request only (not persisted). Top-level keys replace; nested values are not deep-merged: pass the complete value for any key you override. Accepts the same keys as the dashboard filters schema (e.g., `date_from`, `date_to`, `properties`). Ignored when accessed via a sharing token.

idnumberRequired

A unique integer value identifying this dashboard.

include_dashboardsboolean

Opt in to receiving the deprecated `dashboards` field in insight payloads. Once opt-in enforcement is enabled, API-token callers stop receiving it by default; use `dashboard_tiles` instead.

variables_overridestring | object

Object (or pre-encoded JSON string) to override dashboard variables for this request only (not persisted). Format: {"<variable_id>": {"code_name": "<code_name>", "variableId": "<variable_id>", "value": <new_value>}}. Each entry must include `code_name`: partial entries are silently dropped. The simplest workflow is to call `dashboard-get` first, copy the matching entry from the response, and mutate `value`. Top-level keys replace; nested values are not deep-merged. Ignored when accessed via a sharing token.

Run all insights on a dashboard and return their results.

RequiresreadSensitive

Parameters

filters_overridestring | object

Object (or pre-encoded JSON string) to override dashboard filters for this request only (not persisted). Top-level keys replace; nested values are not deep-merged: pass the complete value for any key you override. Accepts the same keys as the dashboard filters schema (e.g., `date_from`, `date_to`, `properties`). Ignored when accessed via a sharing token.

idnumberRequired

A unique integer value identifying this dashboard.

output_formatstring

'optimized' (default) returns LLM-friendly formatted text per insight. 'json' returns the raw query result objects.

Possible values: json, optimized

refreshstring

Cache behavior. 'force_cache' (default) serves from cache even if stale. 'blocking' uses cache if fresh, otherwise recalculates. 'force_blocking' always recalculates.

Possible values: blocking, force_blocking, force_cache

variables_overridestring | object

Object (or pre-encoded JSON string) to override dashboard variables for this request only (not persisted). Format: {"<variable_id>": {"code_name": "<code_name>", "variableId": "<variable_id>", "value": <new_value>}}. Each entry must include `code_name`: partial entries are silently dropped. The simplest workflow is to call `dashboard-get` first, copy the matching entry from the response, and mutate `value`. Top-level keys replace; nested values are not deep-merged. Ignored when accessed via a sharing token.

List and aggregate error tracking issues.

RequiresreadSensitive

Parameters

assigneeobject | null

Filter by issue assignee. Omit to include all assignees.

Show 2 attributes
idstring | numberRequired

User ID or role UUID to filter by.

typestringRequired

Assignee target type: user or role. * `user` - user * `role` - role

Possible values: user, role

dateRangeobject

Date range for issue aggregates. Defaults to the last 7 days.

Show 2 attributes
date_fromstring

Start of the date range as an ISO timestamp or relative date such as -7d. Defaults to -7d.

date_tostring | null

End of the date range as an ISO timestamp or relative date. Defaults to now when omitted.

filePathstring

Search stack-frame source/file path text.

Maximum length 1,000.

filterGrouparray of object

Advanced flat AND property filters. Prefer typed shortcut fields when they fit. HogQL filters are rejected.

Show 4 attributes
keystringRequired

Key of the property you're filtering on. For example `email` or `$current_url`

operatorstring | string | null

Default "exact".

typestring | string

Default "event".

valuestring | number | boolean | array of string | numberRequired

Value of your filter. For example `test@example.com` or `https://example.com/test/`. Can be an array for an OR query, like `["test@example.com","ok@example.com"]`

filterTestAccountsboolean

When true, exclude internal/test account data from results. Defaults to true.

Default true.

fingerprintstring | array of string

Filter by exact exception fingerprint hash, not fuzzy search.

librarystring | array of string

Filter by SDK/library value from event $lib, for example posthog-js.

limitnumber

Page size.

Minimum 1. Maximum 100. Default 25.

offsetnumber

Pagination offset.

Minimum 0. Default 0.

orderBystring

Field used to sort issues. Defaults to occurrences. * `last_seen` - last_seen * `first_seen` - first_seen * `occurrences` - occurrences * `users` - users * `sessions` - sessions

Possible values: last_seen, first_seen, occurrences, users, sessions

Default "occurrences".

orderDirectionstring

Sort direction. Defaults to DESC. * `ASC` - ASC * `DESC` - DESC

Possible values: ASC, DESC

Default "DESC".

personIdstring

Filter by exact PostHog person UUID.

releasestring

Filter by exact release ID, version, or git commit ID captured in $exception_releases.

Maximum length 500.

searchQuerystring

Free-text search across exception types, values, stack frames, and email fields.

Maximum length 500.

statusstring

Filter by issue status. Defaults to active. * `archived` - archived * `active` - active * `resolved` - resolved * `pending_release` - pending_release * `suppressed` - suppressed * `all` - all

Possible values: archived, active, resolved, pending_release, suppressed, all

Default "active".

urlstring

Filter by current URL substring.

Maximum length 1,000.

userstring

Search user/email text.

Maximum length 500.

volumeResolutionnumber

Number of volume buckets. Defaults to 0 for compact aggregate counts.

Minimum 0. Maximum 200. Default 0.

Retrieve details and impact for an error tracking issue.

RequiresreadSensitive

Parameters

dateRangeobject

Date range for issue impact and latest-event metadata. Defaults to the last 7 days.

Show 2 attributes
date_fromstring

Start of the date range as an ISO timestamp or relative date such as -7d. Defaults to -7d.

date_tostring | null

End of the date range as an ISO timestamp or relative date. Defaults to now when omitted.

filterTestAccountsboolean

When true, exclude internal/test account data from results. Defaults to true.

Default true.

includeSparklineboolean

Set true to include a compact numeric occurrence sparkline. Defaults to false.

Default false.

issueIdstringRequired

Error tracking issue ID.

volumeResolutionnumber

Volume buckets. Maximum 200.

Minimum 0. Maximum 200. Default 0.

List feature flags in the current PostHog project.

Requiresread

Parameters

activestring

Possible values: STALE, false, true

archivedstring

Filter by archived state. When omitted, archived flags are excluded.

Possible values: false, true

created_by_idstring

Filter by the user(s) who created the feature flag. Accepts a single user ID, or a JSON-encoded / comma-separated list of user IDs to match any of them.

eligible_for_experimentstring

When 'true', only return flags that can back an experiment: multivariate with 2-20 variants. Any other value is ignored.

Possible values: true

evaluation_runtimestring

Filter feature flags by their evaluation runtime.

Possible values: all, client, server

excluded_propertiesstring

JSON-encoded list of feature flag keys to exclude from the results.

excluded_tagsstring

JSON-encoded list of tag names to exclude. Flags carrying any of these tags are filtered out.

has_evaluation_contextsstring

Filter feature flags by presence of evaluation contexts. 'true' returns only flags with at least one evaluation context, 'false' returns only flags without.

Possible values: false, true

keystring

Filter by exact feature flag key match. Case insensitive.

limitnumber

Number of results to return per page.

offsetnumber

The initial index from which to return the results.

searchstring

Search by feature flag key or name (case-insensitive). Use this to find the flag ID for get/update/delete tools.

tagsstring

JSON-encoded list of tag names to filter feature flags by.

typestring

Possible values: boolean, experiment, multivariant, remote_config

Retrieve a feature flag definition by id.

Requiresread

Parameters

idnumberRequired

A unique integer value identifying this feature flag.

List experiments in the current PostHog project.

Requiresread

Parameters

archivedboolean

Filter by archived state. Defaults to non-archived experiments only.

created_by_idstring

Filter to experiments created by the given user(s). Accepts a single user ID, or a JSON-encoded / comma-separated list of user IDs to match any of them.

eventstring

Filter to experiments whose metrics reference this event name. Matches events used directly in metric queries as well as events behind any actions those metrics reference.

excluded_tagsstring

JSON-encoded list of tag names. Excludes experiments carrying any of the given tags, even when they also carry non-excluded tags.

feature_flag_idnumber

Filter to experiments linked to the given feature flag ID.

limitnumber

Number of results to return per page.

offsetnumber

The initial index from which to return the results.

orderstring

Field to order by. Prefix with '-' for descending. Allowlisted fields include name, created_at, updated_at, start_date, end_date, duration, and status.

prompt_namestring

Filter to experiments created from an LLM prompt with this name. Matches experiments whose parameters.prompt_metadata.name equals the given value.

searchstring

Free-text search applied to the experiment name (case-insensitive).

statusstring

Filter by experiment status. Values: "draft" (not yet launched), "running" (launched, flag active), "paused" (launched, flag deactivated: mutually exclusive with running), "exposure_frozen" (launched, enrollment frozen to the already-exposed cohort while metrics keep flowing), "stopped" or "complete" (both mean ended), "all" (no filter). Defaults to all non-archived experiments.

Possible values: all, complete, draft, exposure_frozen, paused, running, stopped

tagsstring

JSON-encoded list of tag names. Returns experiments carrying at least one of the given tags, e.g. `["growth", "checkout"]`.

Retrieve an experiment by id.

Requiresread

Parameters

idnumberRequired

A unique integer value identifying this experiment.

Retrieve comprehensive results for an experiment.

RequiresreadSensitive

Parameters

idnumberRequired

The ID of the experiment to get comprehensive results for

refreshboolean

Force refresh of results instead of using cached values. Defaults to false.

Default false.

List surveys in the current PostHog project.

Requiresread

Parameters

archivedboolean
created_bynumber

Filter surveys by the ID of the user who created them.

idsarray of string

Multiple values may be separated by commas.

limitnumber

Number of results to return per page.

offsetnumber

The initial index from which to return the results.

searchstring

Match against survey `name` and `description`. Returns exact (case-insensitive substring) matches only; if no exact match exists, returns similar (fuzzy trigram: typos, prefix-as-you-type) matches instead. Each result's `search_match_type` is `exact` or `similar`.

statusstring

Filter surveys by their current status. * `draft` - Draft * `running` - Running * `complete` - Complete

Possible values: complete, draft, running

typestring

* `popover` - popover * `widget` - widget * `external_survey` - external survey * `api` - api

Possible values: api, external_survey, popover, widget

Retrieve a survey by id.

Requiresread

Parameters

idstringRequired

A UUID string identifying this survey.

Retrieve response statistics for a survey.

RequiresreadSensitive

Parameters

date_fromstring (date-time)

Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z)

date_tostring (date-time)

Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z)

idstringRequired

A UUID string identifying this survey.

include_per_question_statsboolean

When true, also return per-question response counts and answer distributions. Adds one extra HogQL query per question, so leave off unless you need the breakdown.

Was this page helpful?
Edit this page on GitHub

On this page