provider insights GET
/api/projects/{project_id}/insights/ @utdk/posthog
/api/projects/{project_id}/insights/ insights_list
DRF ViewSet mixin that gates coalesced responses behind permission checks.
The QueryCoalescingMiddleware attaches cached response data to
request.META["_coalesced_response"] for followers. This mixin runs DRF's
initial() (auth + permissions + throttling) before returning the
cached response, ensuring the request is authorized.
- basic query
- Return basic insight metadata only (no results, faster).
- boolean
- created_by query
- JSON-encoded array of user IDs. Only returns insights whose `created_by` is in the list, e.g. `[1,42]`.
- string
- created_date_from query
- Filter by `created_at > created_date_from`. Accepts absolute or relative dates.
- string
- created_date_to query
- Filter by `created_at < created_date_to`. Accepts absolute or relative dates.
- string
- dashboards query
- JSON-encoded array of dashboard IDs. Returns insights attached to every listed dashboard (AND).
- string
- date_from query
- Filter by `last_modified_at > date_from`. Accepts absolute dates (`2025-04-23`) or relative strings (`-7d`, `-1m`).
- string
- date_to query
- Filter by `last_modified_at < date_to`. Accepts absolute dates or relative strings.
- string
- favorited query
- Include this parameter (any value) to restrict results to insights marked as favorited.
- boolean
- format query
- enum: csv, json
- insight query
- Restrict to a single insight type. `JSON` matches non-wrapper query insights; `SQL` matches HogQL queries.
- enum: FUNNELS, JSON, LIFECYCLE, PATHS…
- last_viewed_date_from query
- Filter by `last_viewed_at > last_viewed_date_from`. Accepts absolute or relative dates.
- string
- last_viewed_date_to query
- Filter by `last_viewed_at < last_viewed_date_to`. Accepts absolute or relative dates.
- string
- limit query
- Number of results to return per page.
- integer
- offset query
- The initial index from which to return the results.
- integer
- project_id path required
- Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
- string
- refresh query
- 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.
- enum: async, async_except_on_cache_miss, blocking, force_async…
- saved query
- When truthy, restricts results to insights that are saved (or attached to a visible dashboard). When falsy, only unsaved insights.
- boolean
- search query
- 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`.
- string
- short_id query
- string
- tags query
- JSON-encoded array of tag names. Returns insights with any of the listed tags.
- string
- user query
- Include this parameter (any value) to restrict results to insights created by the authenticated user.
- boolean
Try it
Authentication
Configure credentials for PostHog API
Code snippet
Updates live as you fill in the form above.
TypeScript
import posthog from '@utdk/posthog';
await posthog.insightsList({
"refresh": "force_cache"
})