PostHog · Capability

PostHog API — product_analytics

PostHog API — product_analytics. 50 operations. Lead operation: product_analytics. Self-contained Naftiko capability covering one Posthog business surface.

Run with Naftiko Posthogproduct_analytics

What You Can Do

GET
Environmentselementslist — environmentselementslist
/v1/api/environments/{environment-id}/elements
POST
Environmentselementscreate — environmentselementscreate
/v1/api/environments/{environment-id}/elements
GET
Environmentselementsstatsretrieve — The original version of this API always and only returned $autocapture elements
/v1/api/environments/{environment-id}/elements/stats
GET
Environmentselementsvaluesretrieve — environmentselementsvaluesretrieve
/v1/api/environments/{environment-id}/elements/values
GET
Environmentselementsretrieve — environmentselementsretrieve
/v1/api/environments/{environment-id}/elements/{id}
PUT
Environmentselementsupdate — environmentselementsupdate
/v1/api/environments/{environment-id}/elements/{id}
PATCH
Environmentselementspartialupdate — environmentselementspartialupdate
/v1/api/environments/{environment-id}/elements/{id}
DELETE
Environmentselementsdestroy — environmentselementsdestroy
/v1/api/environments/{environment-id}/elements/{id}
GET
Environmentsinsightslist — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights
POST
Environmentsinsightscreate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights
GET
Environmentsinsightsallactivityretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights/activity
POST
Environmentsinsightsbulkupdatetagscreate — Bulk update tags on multiple objects.
/v1/api/environments/{environment-id}/insights/bulk-update-tags
POST
Environmentsinsightscancelcreate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights/cancel
POST
Environmentsinsightsgeneratemetadatacreate — Generate an AI-suggested name and description for an insight based on its query configuration.
/v1/api/environments/{environment-id}/insights/generate-metadata
GET
Environmentsinsightsmylastviewedretrieve — Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.
/v1/api/environments/{environment-id}/insights/my-last-viewed
GET
Environmentsinsightstrendingretrieve — Returns trending insights based on view count in the last N days (default 7).
/v1/api/environments/{environment-id}/insights/trending
POST
Environmentsinsightsviewedcreate — Update insight view timestamps.
/v1/api/environments/{environment-id}/insights/viewed
GET
Environmentsinsightsretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights/{id}
PUT
Environmentsinsightsupdate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights/{id}
PATCH
Environmentsinsightspartialupdate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights/{id}
DELETE
Environmentsinsightsdestroy — Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
/v1/api/environments/{environment-id}/insights/{id}
GET
Environmentsinsightsactivityretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights/{id}/activity
GET
Environmentsinsightsanalyzeretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights/{id}/analyze
GET
Environmentsinsightssuggestionsretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights/{id}/suggestions
POST
Environmentsinsightssuggestionscreate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/environments/{environment-id}/insights/{id}/suggestions
GET
Elementslist — elementslist
/v1/api/projects/{project-id}/elements
POST
Elementscreate — elementscreate
/v1/api/projects/{project-id}/elements
GET
Elementsstatsretrieve — The original version of this API always and only returned $autocapture elements
/v1/api/projects/{project-id}/elements/stats
GET
Elementsvaluesretrieve — elementsvaluesretrieve
/v1/api/projects/{project-id}/elements/values
GET
Elementsretrieve — elementsretrieve
/v1/api/projects/{project-id}/elements/{id}
PUT
Elementsupdate — elementsupdate
/v1/api/projects/{project-id}/elements/{id}
PATCH
Elementspartialupdate — elementspartialupdate
/v1/api/projects/{project-id}/elements/{id}
DELETE
Elementsdestroy — elementsdestroy
/v1/api/projects/{project-id}/elements/{id}
GET
Insightslist — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights
POST
Insightscreate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights
GET
Insightsallactivityretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights/activity
POST
Insightsbulkupdatetagscreate — Bulk update tags on multiple objects.
/v1/api/projects/{project-id}/insights/bulk-update-tags
POST
Insightscancelcreate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights/cancel
POST
Insightsgeneratemetadatacreate — Generate an AI-suggested name and description for an insight based on its query configuration.
/v1/api/projects/{project-id}/insights/generate-metadata
GET
Insightsmylastviewedretrieve — Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.
/v1/api/projects/{project-id}/insights/my-last-viewed
GET
Insightstrendingretrieve — Returns trending insights based on view count in the last N days (default 7).
/v1/api/projects/{project-id}/insights/trending
POST
Insightsviewedcreate — Update insight view timestamps.
/v1/api/projects/{project-id}/insights/viewed
GET
Insightsretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights/{id}
PUT
Insightsupdate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights/{id}
PATCH
Insightspartialupdate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights/{id}
DELETE
Insightsdestroy — Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
/v1/api/projects/{project-id}/insights/{id}
GET
Insightsactivityretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights/{id}/activity
GET
Insightsanalyzeretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights/{id}/analyze
GET
Insightssuggestionsretrieve — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights/{id}/suggestions
POST
Insightssuggestionscreate — DRF ViewSet mixin that gates coalesced responses behind permission checks.
/v1/api/projects/{project-id}/insights/{id}/suggestions

MCP Tools

environmentselementslist

environmentselementslist

read-only idempotent
environmentselementscreate

environmentselementscreate

original-version-this-api-always

The original version of this API always and only returned $autocapture elements

read-only idempotent
environmentselementsvaluesretrieve

environmentselementsvaluesretrieve

read-only idempotent
environmentselementsretrieve

environmentselementsretrieve

read-only idempotent
environmentselementsupdate

environmentselementsupdate

idempotent
environmentselementspartialupdate

environmentselementspartialupdate

idempotent
environmentselementsdestroy

environmentselementsdestroy

idempotent
drf-viewset-mixin-that-gates

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-2

DRF ViewSet mixin that gates coalesced responses behind permission checks.

drf-viewset-mixin-that-gates-3

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
bulk-update-tags-multiple-objects

Bulk update tags on multiple objects.

drf-viewset-mixin-that-gates-4

DRF ViewSet mixin that gates coalesced responses behind permission checks.

generate-ai-suggested-name-and

Generate an AI-suggested name and description for an insight based on its query configuration.

read-only
returns-basic-details-about-last

Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.

read-only idempotent
returns-trending-insights-based-view

Returns trending insights based on view count in the last N days (default 7).

read-only idempotent
update-insight-view-timestamps

Update insight view timestamps.

drf-viewset-mixin-that-gates-5

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-6

DRF ViewSet mixin that gates coalesced responses behind permission checks.

idempotent
drf-viewset-mixin-that-gates-7

DRF ViewSet mixin that gates coalesced responses behind permission checks.

idempotent
hard-delete-this-model-is

Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true

idempotent
drf-viewset-mixin-that-gates-8

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-9

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-10

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-11

DRF ViewSet mixin that gates coalesced responses behind permission checks.

elementslist

elementslist

read-only idempotent
elementscreate

elementscreate

original-version-this-api-always-2

The original version of this API always and only returned $autocapture elements

read-only idempotent
elementsvaluesretrieve

elementsvaluesretrieve

read-only idempotent
elementsretrieve

elementsretrieve

read-only idempotent
elementsupdate

elementsupdate

idempotent
elementspartialupdate

elementspartialupdate

idempotent
elementsdestroy

elementsdestroy

idempotent
drf-viewset-mixin-that-gates-12

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-13

DRF ViewSet mixin that gates coalesced responses behind permission checks.

drf-viewset-mixin-that-gates-14

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
bulk-update-tags-multiple-objects-2

Bulk update tags on multiple objects.

drf-viewset-mixin-that-gates-15

DRF ViewSet mixin that gates coalesced responses behind permission checks.

generate-ai-suggested-name-and-2

Generate an AI-suggested name and description for an insight based on its query configuration.

read-only
returns-basic-details-about-last-2

Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.

read-only idempotent
returns-trending-insights-based-view-2

Returns trending insights based on view count in the last N days (default 7).

read-only idempotent
update-insight-view-timestamps-2

Update insight view timestamps.

drf-viewset-mixin-that-gates-16

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-17

DRF ViewSet mixin that gates coalesced responses behind permission checks.

idempotent
drf-viewset-mixin-that-gates-18

DRF ViewSet mixin that gates coalesced responses behind permission checks.

idempotent
hard-delete-this-model-is-2

Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true

idempotent
drf-viewset-mixin-that-gates-19

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-20

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-21

DRF ViewSet mixin that gates coalesced responses behind permission checks.

read-only idempotent
drf-viewset-mixin-that-gates-22

DRF ViewSet mixin that gates coalesced responses behind permission checks.

Capability Spec

posthog-product-analytics.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: PostHog API — product_analytics
  description: 'PostHog API — product_analytics. 50 operations. Lead operation: product_analytics. Self-contained Naftiko
    capability covering one Posthog business surface.'
  tags:
  - Posthog
  - product_analytics
  created: '2026-05-19'
  modified: '2026-05-19'
binds:
- namespace: env
  keys:
    POSTHOG_API_KEY: POSTHOG_API_KEY
capability:
  consumes:
  - type: http
    namespace: posthog-product-analytics
    baseUri: ''
    description: PostHog API — product_analytics business capability. Self-contained, no shared references.
    resources:
    - name: api-environments-environment_id-elements
      path: /api/environments/{environment_id}/elements/
      operations:
      - name: environmentselementslist
        method: GET
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: limit
          in: query
          type: integer
          description: Number of results to return per page.
        - name: offset
          in: query
          type: integer
          description: The initial index from which to return the results.
      - name: environmentselementscreate
        method: POST
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-environments-environment_id-elements-stats
      path: /api/environments/{environment_id}/elements/stats/
      operations:
      - name: environmentselementsstatsretrieve
        method: GET
        description: The original version of this API always and only returned $autocapture elements
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: api-environments-environment_id-elements-values
      path: /api/environments/{environment_id}/elements/values/
      operations:
      - name: environmentselementsvaluesretrieve
        method: GET
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: api-environments-environment_id-elements-id
      path: /api/environments/{environment_id}/elements/{id}/
      operations:
      - name: environmentselementsretrieve
        method: GET
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this element.
          required: true
      - name: environmentselementsupdate
        method: PUT
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this element.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: environmentselementspartialupdate
        method: PATCH
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this element.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: environmentselementsdestroy
        method: DELETE
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this element.
          required: true
    - name: api-environments-environment_id-insights
      path: /api/environments/{environment_id}/insights/
      operations:
      - name: environmentsinsightslist
        method: GET
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: basic
          in: query
          type: boolean
          description: Return basic insight metadata only (no results, faster).
        - name: created_by
          in: query
          type: string
          description: JSON-encoded array of user IDs. Only returns insights whose `created_by` is in the list, e.g. `[1,42]`.
        - name: created_date_from
          in: query
          type: string
          description: Filter by `created_at > created_date_from`. Accepts absolute or relative dates.
        - name: created_date_to
          in: query
          type: string
          description: Filter by `created_at < created_date_to`. Accepts absolute or relative dates.
        - name: dashboards
          in: query
          type: string
          description: JSON-encoded array of dashboard IDs. Returns insights attached to every listed dashboard (AND).
        - name: date_from
          in: query
          type: string
          description: Filter by `last_modified_at > date_from`. Accepts absolute dates (`2025-04-23`) or relative strings
            (`-7d`, `-1m`).
        - name: date_to
          in: query
          type: string
          description: Filter by `last_modified_at < date_to`. Accepts absolute dates or relative strings.
        - name: favorited
          in: query
          type: boolean
          description: Include this parameter (any value) to restrict results to insights marked as favorited.
        - name: format
          in: query
          type: string
        - name: insight
          in: query
          type: string
          description: Restrict to a single insight type. `JSON` matches non-wrapper query insights; `SQL` matches HogQL queries.
        - name: last_viewed_date_from
          in: query
          type: string
          description: Filter by `last_viewed_at > last_viewed_date_from`. Accepts absolute or relative dates.
        - name: last_viewed_date_to
          in: query
          type: string
          description: Filter by `last_viewed_at < last_viewed_date_to`. Accepts absolute or relative dates.
        - name: limit
          in: query
          type: integer
          description: Number of results to return per page.
        - name: offset
          in: query
          type: integer
          description: The initial index from which to return the results.
        - name: refresh
          in: query
          type: string
          description: 'Whether to refresh the retrieved insights, how aggressively, and if sync or async:'
        - name: saved
          in: query
          type: boolean
          description: When truthy, restricts results to insights that are saved (or attached to a visible dashboard). When
            falsy, only unsaved insights.
        - name: search
          in: query
          type: string
          description: Case-insensitive substring match across name, derived_name, description, and tag names.
        - name: short_id
          in: query
          type: string
        - name: tags
          in: query
          type: string
          description: JSON-encoded array of tag names. Returns insights with any of the listed tags.
        - name: user
          in: query
          type: boolean
          description: Include this parameter (any value) to restrict results to insights created by the authenticated user.
      - name: environmentsinsightscreate
        method: POST
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-environments-environment_id-insights-activity
      path: /api/environments/{environment_id}/insights/activity/
      operations:
      - name: environmentsinsightsallactivityretrieve
        method: GET
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
    - name: api-environments-environment_id-insights-bulk_update_tags
      path: /api/environments/{environment_id}/insights/bulk_update_tags/
      operations:
      - name: environmentsinsightsbulkupdatetagscreate
        method: POST
        description: Bulk update tags on multiple objects.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-environments-environment_id-insights-cancel
      path: /api/environments/{environment_id}/insights/cancel/
      operations:
      - name: environmentsinsightscancelcreate
        method: POST
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-environments-environment_id-insights-generate_metadata
      path: /api/environments/{environment_id}/insights/generate_metadata/
      operations:
      - name: environmentsinsightsgeneratemetadatacreate
        method: POST
        description: Generate an AI-suggested name and description for an insight based on its query configuration.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-environments-environment_id-insights-my_last_viewed
      path: /api/environments/{environment_id}/insights/my_last_viewed/
      operations:
      - name: environmentsinsightsmylastviewedretrieve
        method: GET
        description: Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
    - name: api-environments-environment_id-insights-trending
      path: /api/environments/{environment_id}/insights/trending/
      operations:
      - name: environmentsinsightstrendingretrieve
        method: GET
        description: Returns trending insights based on view count in the last N days (default 7).
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
    - name: api-environments-environment_id-insights-viewed
      path: /api/environments/{environment_id}/insights/viewed/
      operations:
      - name: environmentsinsightsviewedcreate
        method: POST
        description: Update insight view timestamps.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-environments-environment_id-insights-id
      path: /api/environments/{environment_id}/insights/{id}/
      operations:
      - name: environmentsinsightsretrieve
        method: GET
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: from_dashboard
          in: query
          type: integer
          description: 'Only if loading an insight in the context of a dashboard: The relevant dashboard''s ID.'
        - name: id
          in: path
          type: string
          description: Numeric primary key or 8-character `short_id` (for example `AaVQ8Ijw`) identifying the insight.
          required: true
        - name: refresh
          in: query
          type: string
          description: 'Whether to refresh the insight, how aggresively, and if sync or async:'
      - name: environmentsinsightsupdate
        method: PUT
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: id
          in: path
          type: string
          description: Numeric primary key or 8-character `short_id` (for example `AaVQ8Ijw`) identifying the insight.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: environmentsinsightspartialupdate
        method: PATCH
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: id
          in: path
          type: string
          description: Numeric primary key or 8-character `short_id` (for example `AaVQ8Ijw`) identifying the insight.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: environmentsinsightsdestroy
        method: DELETE
        description: Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: id
          in: path
          type: string
          description: Numeric primary key or 8-character `short_id` (for example `AaVQ8Ijw`) identifying the insight.
          required: true
    - name: api-environments-environment_id-insights-id-activity
      path: /api/environments/{environment_id}/insights/{id}/activity/
      operations:
      - name: environmentsinsightsactivityretrieve
        method: GET
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this insight.
          required: true
    - name: api-environments-environment_id-insights-id-analyze
      path: /api/environments/{environment_id}/insights/{id}/analyze/
      operations:
      - name: environmentsinsightsanalyzeretrieve
        method: GET
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this insight.
          required: true
    - name: api-environments-environment_id-insights-id-suggestions
      path: /api/environments/{environment_id}/insights/{id}/suggestions/
      operations:
      - name: environmentsinsightssuggestionsretrieve
        method: GET
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this insight.
          required: true
      - name: environmentsinsightssuggestionscreate
        method: POST
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this insight.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-projects-project_id-elements
      path: /api/projects/{project_id}/elements/
      operations:
      - name: elementslist
        method: GET
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: limit
          in: query
          type: integer
          description: Number of results to return per page.
        - name: offset
          in: query
          type: integer
          description: The initial index from which to return the results.
      - name: elementscreate
        method: POST
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-projects-project_id-elements-stats
      path: /api/projects/{project_id}/elements/stats/
      operations:
      - name: elementsstatsretrieve
        method: GET
        description: The original version of this API always and only returned $autocapture elements
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: api-projects-project_id-elements-values
      path: /api/projects/{project_id}/elements/values/
      operations:
      - name: elementsvaluesretrieve
        method: GET
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: api-projects-project_id-elements-id
      path: /api/projects/{project_id}/elements/{id}/
      operations:
      - name: elementsretrieve
        method: GET
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this element.
          required: true
      - name: elementsupdate
        method: PUT
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this element.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: elementspartialupdate
        method: PATCH
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this element.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: elementsdestroy
        method: DELETE
        description: ''
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: id
          in: path
          type: integer
          description: A unique integer value identifying this element.
          required: true
    - name: api-projects-project_id-insights
      path: /api/projects/{project_id}/insights/
      operations:
      - name: insightslist
        method: GET
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: basic
          in: query
          type: boolean
          description: Return basic insight metadata only (no results, faster).
        - name: created_by
          in: query
          type: string
          description: JSON-encoded array of user IDs. Only returns insights whose `created_by` is in the list, e.g. `[1,42]`.
        - name: created_date_from
          in: query
          type: string
          description: Filter by `created_at > created_date_from`. Accepts absolute or relative dates.
        - name: created_date_to
          in: query
          type: string
          description: Filter by `created_at < created_date_to`. Accepts absolute or relative dates.
        - name: dashboards
          in: query
          type: string
          description: JSON-encoded array of dashboard IDs. Returns insights attached to every listed dashboard (AND).
        - name: date_from
          in: query
          type: string
          description: Filter by `last_modified_at > date_from`. Accepts absolute dates (`2025-04-23`) or relative strings
            (`-7d`, `-1m`).
        - name: date_to
          in: query
          type: string
          description: Filter by `last_modified_at < date_to`. Accepts absolute dates or relative strings.
        - name: favorited
          in: query
          type: boolean
          description: Include this parameter (any value) to restrict results to insights marked as favorited.
        - name: format
          in: query
          type: string
        - name: insight
          in: query
          type: string
          description: Restrict to a single insight type. `JSON` matches non-wrapper query insights; `SQL` matches HogQL queries.
        - name: last_viewed_date_from
          in: query
          type: string
          description: Filter by `last_viewed_at > last_viewed_date_from`. Accepts absolute or relative dates.
        - name: last_viewed_date_to
          in: query
          type: string
          description: Filter by `last_viewed_at < last_viewed_date_to`. Accepts absolute or relative dates.
        - name: limit
          in: query
          type: integer
          description: Number of results to return per page.
        - name: offset
          in: query
          type: integer
          description: The initial index from which to return the results.
        - name: refresh
          in: query
          type: string
          description: 'Whether to refresh the retrieved insights, how aggressively, and if sync or async:'
        - name: saved
          in: query
          type: boolean
          description: When truthy, restricts results to insights that are saved (or attached to a visible dashboard). When
            falsy, only unsaved insights.
        - name: search
          in: query
          type: string
          description: Case-insensitive substring match across name, derived_name, description, and tag names.
        - name: short_id
          in: query
          type: string
        - name: tags
          in: query
          type: string
          description: JSON-encoded array of tag names. Returns insights with any of the listed tags.
        - name: user
          in: query
          type: boolean
          description: Include this parameter (any value) to restrict results to insights created by the authenticated user.
      - name: insightscreate
        method: POST
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-projects-project_id-insights-activity
      path: /api/projects/{project_id}/insights/activity/
      operations:
      - name: insightsallactivityretrieve
        method: GET
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
    - name: api-projects-project_id-insights-bulk_update_tags
      path: /api/projects/{project_id}/insights/bulk_update_tags/
      operations:
      - name: insightsbulkupdatetagscreate
        method: POST
        description: Bulk update tags on multiple objects.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: true
    - name: api-projects-project_id-insights-cancel
      path: /api/projects/{project_id}/insights/cancel/
      operations:
      - name: insightscancelcreate
        method: POST
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-projects-project_id-insights-generate_metadata
      path: /api/projects/{project_id}/insights/generate_metadata/
      operations:
      - name: insightsgeneratemetadatacreate
        method: POST
        description: Generate an AI-suggested name and description for an insight based on its query configuration.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-projects-project_id-insights-my_last_viewed
      path: /api/projects/{project_id}/insights/my_last_viewed/
      operations:
      - name: insightsmylastviewedretrieve
        method: GET
        description: Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
    - name: api-projects-project_id-insights-trending
      path: /api/projects/{project_id}/insights/trending/
      operations:
      - name: insightstrendingretrieve
        method: GET
        description: Returns trending insights based on view count in the last N days (default 7).
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
    - name: api-projects-project_id-insights-viewed
      path: /api/projects/{project_id}/insights/viewed/
      operations:
      - name: insightsviewedcreate
        method: POST
        description: Update insight view timestamps.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
    - name: api-projects-project_id-insights-id
      path: /api/projects/{project_id}/insights/{id}/
      operations:
      - name: insightsretrieve
        method: GET
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: from_dashboard
          in: query
          type: integer
          description: 'Only if loading an insight in the context of a dashboard: The relevant dashboard''s ID.'
        - name: id
          in: path
          type: string
          description: Numeric primary key or 8-character `short_id` (for example `AaVQ8Ijw`) identifying the insight.
          required: true
        - name: refresh
          in: query
          type: string
          description: 'Whether to refresh the insight, how aggresively, and if sync or async:'
      - name: insightsupdate
        method: PUT
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
          type: string
        - name: id
          in: path
          type: string
          description: Numeric primary key or 8-character `short_id` (for example `AaVQ8Ijw`) identifying the insight.
          required: true
        - name: body
          in: body
          type: object
          description: Request body (JSON).
          required: false
      - name: insightspartialupdate
        method: PATCH
        description: DRF ViewSet mixin that gates coalesced responses behind permission checks.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
        inputParameters:
        - name: format
          in: query
 

# --- truncated at 32 KB (81 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/posthog/refs/heads/main/capabilities/posthog-product-analytics.yaml