---
title: "Post Query"
method: POST
path: "/insights/query/trends"
---

# Post Query

`POST /insights/query/trends`

## Query parameters

- `limit` integer
- `page` integer
- `sort` string, nullable

## Headers

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

## Cookies

- `session_id` string, nullable

## Request body

- FetchTrendsQuery
  - `currency` string, required
  - `query` TrendsQuery, required
    - `metrics` union[]
      - union
        - EventMetric
          - `name` string, nullable
          - `hidden` boolean, nullable
          - `id` string
          - `filter` MetricFilter
            - `comparator` 'greater_than' | 'less_than', required
            - `value` number, required
          - `type` 'event'
          - `event_name` string, nullable
          - `aggregate` union, required
            - BasicEventMetricAggregate
              - …
            - BasicProductMetricAggregate
              - …
            - CustomPropertyEventMetricAggregate
              - …
            - CustomPropertyProductMetricAggregate
              - …
          - `filters` union[]
            - union
              - …
          - `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
        - AdPlatformMetric
          - `name` string, nullable
          - `hidden` boolean, nullable
          - `id` string
          - `filter` MetricFilter
            - `comparator` 'greater_than' | 'less_than', required
            - `value` number, required
          - `type` 'ad_platform'
          - `column` union, required
            - AdPlatformClickMetric
              - …
            - AdPlatformSpendMetric
              - …
            - AdPlatformImpressionsMetric
              - …
            - AdPlatformPurchaseConversionsMetric
              - …
            - AdPlatformCustomConversionsMetric
              - …
            - AdPlatformBuiltinMetric — Hard-coded built-in metrics, currently only NB NV%
              - …
          - `filters` union[]
            - union
              - …
        - FormulaMetric
          - `name` string, nullable
          - `hidden` boolean, nullable
          - `id` string
          - `filter` MetricFilter
            - `comparator` 'greater_than' | 'less_than', required
            - `value` number, required
          - `type` 'formula'
          - `formula` string, required
    - `filters` AllOfFilters
      - `all_of` AnyOfFilters[]
        - `any_of` union[]
          - union
            - EventPropertyFilter
              - …
            - EventSourceFilter
              - …
            - AdPlatformPropertyFilter
              - …
            - AdPlatformSourceFilter
              - …
            - TouchpointFilter
              - …
            - CustomDimensionFilter
              - …
            - AdPropertiesFilter
              - …
    - `breakdown` union
      - EventPropertyBreakdown
        - `type` 'event'
        - `scope` 'event' | 'profile' | 'session' | 'product', required
        - `property_name` union, required
          - string
          - union
            - RevenueProperty
              - …
            - TaxProperty
              - …
            - DiscountProperty
              - …
            - ShippingProperty
              - …
            - NetRevenueAfterTaxProperty
              - …
            - NetRevenueAfterTaxAndShippingProperty
              - …
            - ProductIDsProperty
              - …
            - VariantIDsProperty
              - …
            - ProductSKUsProperty
              - …
            - ProductNamesProperty
              - …
            - ProductBundleIds
              - …
            - ProductBundleNames
              - …
            - NumberOfItemsProperty
              - …
            - PaymentMethodProperty
              - …
            - SalesChannelTypeProperty
              - …
            - URLProperty
              - …
            - FullURLProperty
              - …
            - ReferrerProperty
              - …
            - LandingURLProperty
              - …
            - FullLandingURLProperty
              - …
            - LandingURLDomainProperty
              - …
            - LandingURLPathProperty
              - …
            - TimezoneProperty
              - …
            - LanguageProperty
              - …
            - TitleProperty
              - …
            - DeviceBrandProperty
              - …
            - DeviceModelProperty
              - …
            - DeviceTypeProperty
              - …
            - OSProperty
              - …
            - BrowserProperty
              - …
            - GenderGuessProperty
              - …
            - GeoIPCityNameProperty
              - …
            - GeoIPCountryNameProperty
              - …
            - GeoIPCountryCodeProperty
              - …
            - GeoIPRegionNameProperty
              - …
            - GeoIPZipCodeProperty
              - …
            - IsCustomerProperty
              - …
            - IsNewVisitorProperty
              - …
            - UtmSourceMedium
              - …
            - FullSessionReferrerProperty
              - …
            - ProfileIDProperty
              - …
            - OrderIDProperty
              - …
            - ProductPriceProperty
              - …
            - ProductQuantityProperty
              - …
            - ProductRevenueProperty
              - …
            - ProductDiscountProperty
              - …
            - ProductTaxesProperty
              - …
            - ProductShippingProperty
              - …
            - ProductNetRevenueProperty
              - …
            - COGSProperty
              - …
            - GrossProfitProperty
              - …
            - PaymentProcessingFeeProperty
              - …
            - ShippingCostProperty
              - …
            - GrossRevenueProperty
              - …
            - ContributionProfitProperty
              - …
        - `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'
  - `timezone` string, required
  - `start_of_week` 0 | 1
  - `include_totals` boolean
  - `breakdown_limit` integer, nullable
  - `invalidate_cache` boolean
  - `insight_id` integer, nullable

## Response `200`

Successful Response

## 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)
