Views

Generate View Table Data

Generate paginated table data for a view. This endpoint executes the view's query against transformations from the specified functions, applies the defined filters, and returns matching rows with their column values. The request includes the view configuration (columns, filters, function IDs), a time window to filter transformations by creation date, and optional pagination parameters (limit and offset). The response contains an array of rows, where each row contains column values extracted from a transformation, and the total count of matching rows (before pagination). Note: The functions field in the view configuration is required. At least one function ID or name must be specified.

POST
/v2/views/table-data
x-api-key<token>

Authenticate using API Key in request header

In: header

Request Body

application/json

name*string

Name of the view

columns*

List of columns in the view

filters*

List of filters applied to the view

aggregations*

List of aggregations defined for the view

functions*

List of functions that this view queries transformations from

timeWindow*

Time window for filtering transformations in a view

limit?integer

Maximum number of rows to return (default: 50, max: 200)

Range1 <= value <= 200
offset?integer

Number of rows to skip for pagination

Range0 <= value

Response Body

application/json

application/json

curl -X POST "https://api.bem.ai/v2/views/table-data" \  -H "Content-Type: application/json" \  -d '{    "name": "Invoice Overview",    "columns": [      {        "name": "Invoice Number",        "valueSchemaPath": [          "invoiceDetails",          "invoiceNumber"        ],        "displayOrderIndex": 0      }    ],    "filters": [      {        "columnName": "Invoice Amount",        "filterType": "equals_string"      }    ],    "aggregations": [      {        "name": "Total Revenue",        "function": "count"      }    ],    "functions": [      {        "id": "string",        "name": "string"      }    ],    "timeWindow": {      "start": "2024-01-01T00:00:00Z",      "end": "2024-01-31T23:59:59Z"    }  }'
{
  "rows": [
    {
      "columns": [
        {
          "columnName": "Invoice Number",
          "value": "INV-123"
        }
      ],
      "transformationID": 12345
    }
  ],
  "totalCount": 150
}
{
  "message": "invalid request body: missing required field 'transformationIDs'",
  "code": 400,
  "details": {
    "field": "transformationIDs",
    "reason": "required field missing"
  }
}