insights

get/api/projects/{project_id}/insights/

Request

  • Base URL: https://us.posthog.com
  • URL: https://us.posthog.com/api/projects/{project_id}/insights/
  • Auth: HTTP bearer

Path parameters

project_idstring required

Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.

Query parameters

basicboolean

Return basic insight metadata only (no results, faster).

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.

exclude_biboolean

Exclude Business intelligence worksheets from the insight list.

favoritedboolean

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

format'csv' | 'json'
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.

insight'BI' | 'FUNNELS' | 'JOURNEYS' | 'JSON' | 'LIFECYCLE' | 'PATHS' | 'RETENTION' | 'SQL' | 'STICKINESS' | 'TRENDS'

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

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.

limitinteger

Number of results to return per page.

offsetinteger

The initial index from which to return the results.

orderstring

Sort by an insight field, with a leading minus for descending order. Supports last_modified_at and last_viewed_at.

refresh'async' | 'async_except_on_cache_miss' | 'blocking' | 'force_async' | 'force_blocking' | 'force_cache' | 'lazy_async'

Whether to refresh the retrieved insights, how aggressively, and if sync or async:

  • 'force_cache' - return cached data or a cache miss; always completes immediately as it never calculates
  • 'blocking' - calculate synchronously (returning only when the query is done), UNLESS there are very fresh results in the cache
  • 'async' - kick off background calculation (returning immediately with a query status), UNLESS there are very fresh results in the cache
  • 'lazy_async' - kick off background calculation, UNLESS there are somewhat fresh results in the cache
  • 'force_blocking' - calculate synchronously, even if fresh results are already cached
  • 'force_async' - kick off background calculation, even if fresh results are already cached Background calculation can be tracked using the query_status response field.
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.

Response

countinteger required
nextstring uri nullable
previousstring uri nullable

Changes

No recorded changes to this operation across all 1 revision of this API.