---
title: "Generate View Table Data"
method: POST
path: "/v3/views/table-data"
tags: ["Views"]
---

# Generate View Table Data

`POST /v3/views/table-data`

**Generate paginated table data for a view.**

Executes the view's query against `transformations` rows produced by the
named functions inside the supplied `timeWindow`, applies the view's
filters, and returns matching rows. Each row reports the event
`eventID` (externally-stable KSUID) plus the projected column values.

The `functions` field is required — at least one `functionID` or
`functionName` must be supplied. `limit` defaults to 50 with a maximum
of 200; `offset` is zero-based. The response's `totalCount` reflects
the match count before pagination, so paging can be driven off it.

## Request body

- ViewTableDataRequest
  - `name` string, required — Name of the view
  - `description` string — Description of the view
  - `columns` ViewColumn[], required — List of columns in the view
    - `name` string, required — Name of the column
    - `valueSchemaPath` string[], required — JSON path to the value in the transformation output schema (e.g., ["invoiceDetails", "invoiceNumber"])
    - `displayOrderIndex` integer, required — Order in which this column should be displayed (0-based index)
  - `filters` ViewFilter[], required — List of filters applied to the view
    - `columnName` string, required — Name of the column to filter on
    - `filterType` 'equals_string' | 'equals_number' | 'less_than_number' | 'less_than_equal_number' | 'greater_than_number' | 'greater_than_equal_number' | 'is_null' | 'is_not_null', required — Type of filter to apply to a view column
    - `string` string, nullable — String value for the filter (required for string filter types)
    - `number` number, float, nullable — Numeric value for the filter (required for number filter types)
  - `aggregations` ViewAggregation[], required — List of aggregations defined for the view
    - `name` string, required — Name of the aggregation
    - `function` 'count' | 'count_distinct' | 'sum' | 'average' | 'min' | 'max', required — Aggregation function to apply to a view column
    - `aggregateColumnName` string, nullable — Name of the column to aggregate (required for count_distinct, sum, average, min, max functions)
    - `groupByColumnName` string, nullable — Name of the column to group by (optional, for grouped aggregations)
    - `displayType` 'table' | 'bar_chart' | 'pie_chart' — How to display the aggregation results
  - `functions` FunctionIdentifier[], required — List of functions that this view queries transformations from
    - `id` string — Unique identifier of function. Provide either id or name, not both.
    - `name` string — Name of function. Must be UNIQUE on a per-environment basis. Provide either id or name, not both.
  - `timeWindow` TimeWindow, required — Time window for filtering transformations in a view
    - `start` string, date-time, required — Start of the time window in ISO 8601 (RFC 3339) format in UTC
    - `end` string, date-time, required — End of the time window in ISO 8601 (RFC 3339) format in UTC
  - `limit` integer, nullable — Maximum number of rows to return (default: 50, max: 200)
  - `offset` integer, nullable — Number of rows to skip for pagination

## Response `200`

The request has succeeded.

- ViewTableDataResponse — Response containing paginated view table data
  - `rows` ViewTableDataResponseRow[], required — Array of rows matching the view configuration
    - `columns` ViewTableDataResponseColumnEntry[], required — Column entries for this row
      - `columnName` string, required — Name of the column
      - `value` union, required — Value of the column (can be any JSON type)
        - string
        - number
        - boolean
        - unknown
        - object
        - unknown[]
          - unknown
    - `eventID` string, required — Externally-stable KSUID of the event whose underlying transformation produced this row.
  - `totalCount` integer, required — Total number of rows matching the view (before pagination)

## Other responses

- `400` — The server could not understand the request due to invalid syntax.

---

[API](https://skmtc.dev/bem-team/apis/bem-api.md) · [All operations](https://skmtc.dev/bem-team/apis/bem-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/bem-team/bem-api/revisions/a6e4624117c6/schema)
