Insights
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
POST | |
POST | |
GET | |
GET | |
POST |
Create insights data checks
Check the events behind an insight for the common ways they mislead: local development traffic, bots and crawlers, and events sent twice. Works for trends, funnels, stickiness and lifecycle insights whose series are events. The checks apply the insight's own filters, and read the newest days of its date range, up to 7. The bot and duplicate checks read a sample of those days. Nothing is stored. This route runs the query it is sent, so it needs query access as well as insight access. To check a saved insight by its id, send a GET request to insights/{id}/data_checks/.
Required API key scopes
insight:readquery:readQuery parameters
- formatstringOne of:
"csv""json"
Request parameters
- query
Response
Example request
POST /api /projects /:project_id /insights /data_checksExample response
Status 200 The result of every check.
Create insights generate metadata
Generate an AI-suggested name and description for an insight based on its query configuration.
Required API key scopes
insight:writeQuery parameters
- formatstringOne of:
"csv""json"
Request parameters
- namestring | null
- derived_namestring | null
- query
- orderinteger | null
- deletedboolean
- dashboardsarray
- descriptionstring | null
- tagsarray
- favoritedboolean
- _create_in_folderstring
Example request
POST /api /projects /:project_id /insights /generate_metadataExample response
Status 200 No response body
Retrieve insights my last viewed
Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.
Query parameters
- formatstringOne of:
"csv""json"
Example request
GET /api /projects /:project_id /insights /my_last_viewedExample response
Status 200 No response body
Retrieve insights trending
Also available via the PostHog MCP server:
insights-trending-retrieve— Get most-viewed insights
Returns insights ranked by view count over the last N days (default 7), highest first. Each result includes the same metadata as the standard insights list, plus a view_count and up to 3 recent viewers. Useful for surfacing the most-used insights in a project.
Required API key scopes
insight:readQuery parameters
- daysinteger
- formatstringOne of:
"csv""json" - include_dashboardsboolean
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /insights /trendingExample response
Status 200
Create insights viewed
Record that the current user has just viewed one or more insights. Submitted ids that do not belong to the current project or that point at deleted insights are silently dropped, as are views from impersonated staff-support sessions. Returns 201 on success regardless of how many ids were retained.
Required API key scopes
insight:readQuery parameters
- formatstringOne of:
"csv""json"
Request parameters
- insight_idsarray
Example request
POST /api /projects /:project_id /insights /viewed










