---
title: "Create Insight"
method: POST
path: "/insights"
---

# Create Insight

`POST /insights`

## Headers

- `Authorization` string, nullable
- `X-User-Id` string, nullable
- `X-Posthog-Session-Id` string

## Cookies

- `session_id` string, nullable

## Request body

- union
  - CreateInsightSchema
    - `dashboards` integer[]
    - `description` string, nullable
    - `name` string, required
    - `query` union, required
      - TrendsQuery
        - `metrics` union[]
          - union
            - EventMetric
              - …
            - AdPlatformMetric
              - …
            - FormulaMetric
              - …
        - `filters` AllOfFilters
          - `all_of` AnyOfFilters[]
            - `any_of` union[]
              - …
        - `breakdown` union
          - EventPropertyBreakdown
            - `type` 'event'
            - `scope` 'event' | 'profile' | 'session' | 'product', required
            - `property_name` union, required
              - …
            - `property_type` 'string' | 'numeric' | 'boolean' | 'list_of_strings', required
          - EventSourceBreakdown
            - `type` 'event_source'
          - AdPlatformSourceBreakdown
            - `type` 'ad_platform_source'
          - TouchpointBreakdown
            - `type` 'touchpoint'
            - `property` 'channel_group' | 'channel' | 'campaign' | 'adset' | 'ad', required
          - CustomDimensionBreakdown
            - `type` 'custom_dimension'
            - `custom_dimension_id` integer, required
        - `date_range` DateRangeQuery, required
          - `since` union, required
            - string, date
            - string, date-time
            - string
          - `until` union
            - string, date
            - string, date-time
            - string
        - `time_granularity` 'hour' | 'day' | 'week' | 'month' | 'second'
        - `compare` union
          - true
          - string, date
          - string
        - `attribution` ConvergeApiAttributionsAttribution
          - `mode` 'click_time' | 'conversion_time'
          - `model` 'first_touch' | 'first_touch_paid' | 'inv_j_shaped' | 'j_shaped' | 'j_shaped_paid' | 'last_touch' | 'last_touch_paid' | 'linear' | 'participation' | 'time_decay' | 'inv_time_decay' | 'u_shaped' | 'direct_session' | 'inv_j_shaped_paid' | 'top_of_funnel'
          - `window` integer
          - `lookback` integer, nullable
        - `type` 'trends'
      - CohortsQuery
        - `metric` CohortMetric
          - `name` string, nullable
          - `hidden` boolean, nullable
          - `id` string
          - `filter` MetricFilter
            - `comparator` 'greater_than' | 'less_than', required
            - `value` number, required
          - `aggregate` CohortEventMetricAggregate
            - `type` 'ltv' | 'churn_rate' | 'total' | 'retention_rate' | 'repurchase_rate'
        - `filters` AllOfFilters
          - `all_of` AnyOfFilters[]
            - `any_of` union[]
              - …
        - `breakdown` union
          - EventPropertyBreakdown
            - `type` 'event'
            - `scope` 'event' | 'profile' | 'session' | 'product', required
            - `property_name` union, required
              - …
            - `property_type` 'string' | 'numeric' | 'boolean' | 'list_of_strings', required
          - EventSourceBreakdown
            - `type` 'event_source'
          - AdPlatformSourceBreakdown
            - `type` 'ad_platform_source'
          - TouchpointBreakdown
            - `type` 'touchpoint'
            - `property` 'channel_group' | 'channel' | 'campaign' | 'adset' | 'ad', required
          - CustomDimensionBreakdown
            - `type` 'custom_dimension'
            - `custom_dimension_id` integer, required
        - `date_range` DateRangeQuery
          - `since` union, required
            - string, date
            - string, date-time
            - string
          - `until` union
            - string, date
            - string, date-time
            - string
        - `period` integer, nullable
        - `time_granularity` 'hour' | 'day' | 'week' | 'month' | 'second', required
        - `attribution_model` 'first_touch' | 'first_touch_paid' | 'inv_j_shaped' | 'j_shaped' | 'j_shaped_paid' | 'last_touch' | 'last_touch_paid' | 'linear' | 'participation' | 'time_decay' | 'inv_time_decay' | 'u_shaped' | 'direct_session' | 'inv_j_shaped_paid' | 'top_of_funnel'
        - `type` 'cohorts'
    - `tags` string[]
    - `viz` 'area_chart' | 'bar_chart' | 'line_chart' | 'table' | 'total_number' | 'total_pie_chart' | 'total_bar_chart' | 'total_table' | 'cohort_table', required
    - `viz_options` InsightVizOptions
      - `breakdown_limit` integer, nullable
      - `currency` string, nullable
      - `legend_position` 'bottom' | 'left' | 'right' | 'top'
      - `show_comparison_bar` boolean
      - `show_legend` boolean
      - `show_totals` boolean
      - `show_values` boolean
      - `show_row_numbers` boolean
      - `sort_by` string, nullable
      - `use_compact_legend` boolean
      - `use_compact_notation` boolean, nullable
  - CopyInsightSchema
    - `source_id` integer, required
    - `dashboards` integer[]

## Response `200`

Successful Response

- InsightResponseSchema
  - `created_at` string, date-time, required
  - `dashboards` DashboardInsightSchema[]
    - `dashboard_id` integer, required
    - `insight_id` integer, required
    - `layout` DashboardInsightLayout, required
      - `x` integer, required
      - `y` integer, required
      - `w` integer, required
      - `h` integer, required
  - `description` string, nullable
  - `id` integer, required
  - `name` string, required
  - `query` union, required
    - TrendsQuery
      - `metrics` union[]
        - union
          - EventMetric
            - `name` string, nullable
            - `hidden` boolean, nullable
            - `id` string
            - `filter` MetricFilter
              - …
            - `type` 'event'
            - `event_name` string, nullable
            - `aggregate` union, required
              - …
            - `filters` union[]
              - …
            - `attribution` ConvergeApiAttributionsAttribution
              - …
          - AdPlatformMetric
            - `name` string, nullable
            - `hidden` boolean, nullable
            - `id` string
            - `filter` MetricFilter
              - …
            - `type` 'ad_platform'
            - `column` union, required
              - …
            - `filters` union[]
              - …
          - FormulaMetric
            - `name` string, nullable
            - `hidden` boolean, nullable
            - `id` string
            - `filter` MetricFilter
              - …
            - `type` 'formula'
            - `formula` string, required
      - `filters` AllOfFilters
        - `all_of` AnyOfFilters[]
          - `any_of` union[]
            - union
              - …
      - `breakdown` union
        - EventPropertyBreakdown
          - `type` 'event'
          - `scope` 'event' | 'profile' | 'session' | 'product', required
          - `property_name` union, required
            - string
            - union
              - …
          - `property_type` 'string' | 'numeric' | 'boolean' | 'list_of_strings', required
        - EventSourceBreakdown
          - `type` 'event_source'
        - AdPlatformSourceBreakdown
          - `type` 'ad_platform_source'
        - TouchpointBreakdown
          - `type` 'touchpoint'
          - `property` 'channel_group' | 'channel' | 'campaign' | 'adset' | 'ad', required
        - CustomDimensionBreakdown
          - `type` 'custom_dimension'
          - `custom_dimension_id` integer, required
      - `date_range` DateRangeQuery, required
        - `since` union, required
          - string, date
          - string, date-time
          - string
        - `until` union
          - string, date
          - string, date-time
          - string
      - `time_granularity` 'hour' | 'day' | 'week' | 'month' | 'second'
      - `compare` union
        - true
        - string, date
        - string
      - `attribution` ConvergeApiAttributionsAttribution
        - `mode` 'click_time' | 'conversion_time'
        - `model` 'first_touch' | 'first_touch_paid' | 'inv_j_shaped' | 'j_shaped' | 'j_shaped_paid' | 'last_touch' | 'last_touch_paid' | 'linear' | 'participation' | 'time_decay' | 'inv_time_decay' | 'u_shaped' | 'direct_session' | 'inv_j_shaped_paid' | 'top_of_funnel'
        - `window` integer
        - `lookback` integer, nullable
      - `type` 'trends'
    - CohortsQuery
      - `metric` CohortMetric
        - `name` string, nullable
        - `hidden` boolean, nullable
        - `id` string
        - `filter` MetricFilter
          - `comparator` 'greater_than' | 'less_than', required
          - `value` number, required
        - `aggregate` CohortEventMetricAggregate
          - `type` 'ltv' | 'churn_rate' | 'total' | 'retention_rate' | 'repurchase_rate'
      - `filters` AllOfFilters
        - `all_of` AnyOfFilters[]
          - `any_of` union[]
            - union
              - …
      - `breakdown` union
        - EventPropertyBreakdown
          - `type` 'event'
          - `scope` 'event' | 'profile' | 'session' | 'product', required
          - `property_name` union, required
            - string
            - union
              - …
          - `property_type` 'string' | 'numeric' | 'boolean' | 'list_of_strings', required
        - EventSourceBreakdown
          - `type` 'event_source'
        - AdPlatformSourceBreakdown
          - `type` 'ad_platform_source'
        - TouchpointBreakdown
          - `type` 'touchpoint'
          - `property` 'channel_group' | 'channel' | 'campaign' | 'adset' | 'ad', required
        - CustomDimensionBreakdown
          - `type` 'custom_dimension'
          - `custom_dimension_id` integer, required
      - `date_range` DateRangeQuery
        - `since` union, required
          - string, date
          - string, date-time
          - string
        - `until` union
          - string, date
          - string, date-time
          - string
      - `period` integer, nullable
      - `time_granularity` 'hour' | 'day' | 'week' | 'month' | 'second', required
      - `attribution_model` 'first_touch' | 'first_touch_paid' | 'inv_j_shaped' | 'j_shaped' | 'j_shaped_paid' | 'last_touch' | 'last_touch_paid' | 'linear' | 'participation' | 'time_decay' | 'inv_time_decay' | 'u_shaped' | 'direct_session' | 'inv_j_shaped_paid' | 'top_of_funnel'
      - `type` 'cohorts'
  - `tags` string[]
  - `updated_at` string, date-time, required
  - `viz` 'area_chart' | 'bar_chart' | 'line_chart' | 'table' | 'total_number' | 'total_pie_chart' | 'total_bar_chart' | 'total_table' | 'cohort_table', required
  - `viz_options` InsightVizOptions
    - `breakdown_limit` integer, nullable
    - `currency` string, nullable
    - `legend_position` 'bottom' | 'left' | 'right' | 'top'
    - `show_comparison_bar` boolean
    - `show_legend` boolean
    - `show_totals` boolean
    - `show_values` boolean
    - `show_row_numbers` boolean
    - `sort_by` string, nullable
    - `use_compact_legend` boolean
    - `use_compact_notation` boolean, nullable
  - `creator` AccountSchema
    - `id` integer, required
    - `email` string, required
    - `first_name` string, nullable
    - `last_name` string, nullable
    - `profile_picture_url` string, nullable
  - `editor` AccountSchema
    - `id` integer, required
    - `email` string, required
    - `first_name` string, nullable
    - `last_name` string, nullable
    - `profile_picture_url` string, nullable
  - `favorited` boolean
  - `public_token` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/runconverge/apis/fastapi.md) · [All operations](https://skmtc.dev/runconverge/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runconverge/fastapi/revisions/1452e350bd1d/schema)
