Insights
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
POST | |
DELETE | |
POST | |
GET | |
GET | |
GET | |
PATCH | |
DELETE | |
GET | |
GET | |
GET | |
POST | |
GET | |
POST | |
POST | |
POST |
List all insights
Also available via the PostHog MCP server:
insights-list— Get all insights
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.
Required API key scopes
insight:readQuery parameters
- basicboolean
- created_bystring
- created_date_fromstring
- created_date_tostring
- dashboardsstring
- date_fromstring
- date_tostring
- favoritedboolean
- formatstringOne of:
"csv""json" - include_dashboardsboolean
- insightstringOne of:
"FUNNELS""JOURNEYS""JSON""LIFECYCLE""PATHS""RETENTION""SQL""STICKINESS""TRENDS" - last_viewed_date_fromstring
- last_viewed_date_tostring
- limitinteger
- offsetinteger
- refreshstringDefault:
force_cacheOne of:"async""async_except_on_cache_miss""blocking""force_async""force_blocking""force_cache""lazy_async" - savedboolean
- searchstring
- short_idstring
- tagsstring
- userboolean
Response
Example request
GET /api /projects /:project_id /insightsExample response
Status 200
Create insights
Also available via the PostHog MCP server:
insight-create— Create insight
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.
Required API key scopes
insight:writeQuery parameters
- formatstringOne of:
"csv""json" - include_dashboardsboolean
Request parameters
- namestringnull
- derived_namestringnull
- query
- orderintegernull
- deletedboolean
- dashboardsarray
- descriptionstringnull
- tagsarray
- favoritedboolean
- _create_in_folderstring
Response
Example request
POST /api /projects /:project_id /insightsExample response
Status 201
List all insights sharing
Required API key scopes
sharing_configuration:readPath parameters
- insight_idinteger
Example request
GET /api /projects /:project_id /insights /:insight_id /sharingExample response
Status 200
Create insights sharing passwords
Create a new password for the sharing configuration.
Required API key scopes
sharing_configuration:writePath parameters
- insight_idinteger
Request parameters
- enabledboolean
- settings
- password_requiredboolean
Response
Example request
POST /api /projects /:project_id /insights /:insight_id /sharing /passwordsExample response
Status 200
Delete insights sharing passwords
Delete a password from the sharing configuration.
Required API key scopes
sharing_configuration:writePath parameters
- insight_idinteger
- password_idstring
Example request
DELETE /api /projects /:project_id /insights /:insight_id /sharing /passwords /:password_idExample response
Status 204 No response body
Create insights sharing refresh
Required API key scopes
sharing_configuration:writePath parameters
- insight_idinteger
Request parameters
- enabledboolean
- settings
- password_requiredboolean
Response
Example request
POST /api /projects /:project_id /insights /:insight_id /sharing /refreshExample response
Status 200
List all insights thresholds
Required API key scopes
alert:readPath parameters
- insight_idinteger
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /insights /:insight_id /thresholdsExample response
Status 200
Retrieve insights thresholds
Required API key scopes
alert:readPath parameters
- idstring
- insight_idinteger
Response
Example request
GET /api /projects /:project_id /insights /:insight_id /thresholds /:idExample response
Status 200
Retrieve insights
Also available via the PostHog MCP server:
insight-get— Get insight
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.
Required API key scopes
insight:readPath parameters
- id
Query parameters
- filters_overridestring
- formatstringOne of:
"csv""json" - from_dashboardinteger
- include_dashboardsboolean
- refreshstringDefault:
force_cacheOne of:"async""async_except_on_cache_miss""blocking""force_async""force_blocking""force_cache""lazy_async" - variables_overridestring
Response
Example request
GET /api /projects /:project_id /insights /:idExample response
Status 200
Update insights
Also available via the PostHog MCP server:
insight-update— Update insight
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.
Required API key scopes
insight:writePath parameters
- id
Query parameters
- formatstringOne of:
"csv""json" - include_dashboardsboolean
Request parameters
- namestringnull
- derived_namestringnull
- query
- orderintegernull
- deletedboolean
- dashboardsarray
- descriptionstringnull
- tagsarray
- favoritedboolean
- _create_in_folderstring
Response
Example request
PATCH /api /projects /:project_id /insights /:idExample response
Status 200
Delete insights
Also available via the PostHog MCP server:
insight-delete— Delete insight
Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
Required API key scopes
insight:writePath parameters
- id
Query parameters
- formatstringOne of:
"csv""json"
Example request
DELETE /api /projects /:project_id /insights /:idExample response
Status 405 No response body
Retrieve insights activity
Also available via the PostHog MCP server:
insights-activity-retrieve— Get insight activity log
Audit trail for a single insight — every change made to it, by whom, and when. Use this when you want the change history of a specific insight; use the project-wide activity endpoint for a broader view.
Required API key scopes
activity_log:readPath parameters
- idinteger
Query parameters
- formatstringOne of:
"csv""json" - limitinteger
- pageinteger
Response
Example request
GET /api /projects /:project_id /insights /:id /activityExample response
Status 200
Retrieve insights analyze
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.
Path parameters
- idinteger
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /insights /:id /analyzeExample response
Status 200 No response body
Retrieve insights suggestions
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.
Path parameters
- idinteger
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /insights /:id /suggestionsExample response
Status 200 No response body
Create insights suggestions
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.
Path parameters
- idinteger
Query parameters
- formatstringOne of:
"csv""json"
Request parameters
- namestringnull
- derived_namestringnull
- query
- orderintegernull
- deletedboolean
- dashboardsarray
- descriptionstringnull
- tagsarray
- favoritedboolean
- _create_in_folderstring
Example request
POST /api /projects /:project_id /insights /:id /suggestionsExample response
Status 200 No response body
Retrieve insights all activity
Also available via the PostHog MCP server:
insights-all-activity-retrieve— Get recent insight activity across the project
Project-wide audit trail across all insights — who created, edited, deleted, or restored insights, what changed (with before/after diffs), and when. Useful for surfacing what people (or agents) have been working on recently.
Required API key scopes
activity_log:readQuery parameters
- formatstringOne of:
"csv""json" - limitinteger
- pageinteger
Response
Example request
GET /api /projects /:project_id /insights /activityExample response
Status 200
Create insights bulk delete
Soft-delete insights in bulk by ID. Mirrors the single-insight delete: sets deleted=True, soft-deletes the insights' dashboard tiles, and removes their linked alerts. Insights the requester cannot edit are skipped and reported in skipped. Reversible via the bulk_restore endpoint.
Required API key scopes
insight:writeQuery parameters
- formatstringOne of:
"csv""json"
Request parameters
- idsarray
Response
Example request
POST /api /projects /:project_id /insights /bulk_deleteExample response
Status 200
Create insights bulk restore
Restore soft-deleted insights in bulk by ID — the inverse of bulk_delete. Sets deleted=False and re-activates the insights' dashboard tiles on dashboards that still exist. Linked alerts are not restored (they are removed on delete). Insights the requester cannot edit are reported in skipped.
Required API key scopes
insight:writeQuery parameters
- formatstringOne of:
"csv""json"
Request parameters
- idsarray
Response
Example request
POST /api /projects /:project_id /insights /bulk_restoreExample response
Status 200
Create insights bulk set test account filter
Turn 'filter out internal and test users' on or off for every existing insight in the project. Requires project admin, matching the settings UI that fronts it. The setting of the same name only decides the default for new insights; this applies it to the insights that already exist. Only insights that store a query are changed; insights still holding legacy filters are counted in legacy and left as they are. Insights with nowhere to put the toggle, such as SQL insights, are left alone, as are insights the requester cannot edit. Dashboards follow their insights unless the dashboard sets its own override. Insights are updated in batches, so a failure part way through leaves the finished batches applied. Retrying is safe and picks up the rest.
Required API key scopes
insight:writeQuery parameters
- formatstringOne of:
"csv""json"
Request parameters
- enabledboolean
Response
Example request
POST /api /projects /:project_id /insights /bulk_set_test_account_filter