Views

Update a View

Update an existing view. This creates a new version of the view with the updated configuration. The view ID in the path identifies which view to update, and the request body contains the new view configuration. The version number will be automatically incremented.

PUT
/v2/views/{view_id}
x-api-key<token>

Authenticate using API Key in request header

In: header

Path Parameters

view_id*string

Unique identifier of the view to update

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

Response Body

application/json

curl -X PUT "https://api.bem.ai/v2/views/v_2N6gH8ZKCmvb6BnFcGqhKJ98VzP" \  -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"      }    ]  }'
{
  "viewID": "v_2N6gH8ZKCmvb6BnFcGqhKJ98VzP",
  "name": "Invoice Overview",
  "description": "This view provides an overview of all invoices.",
  "displayType": "table",
  "currentVersionNum": 1,
  "columns": [
    {
      "name": "Invoice Number",
      "valueSchemaPath": [
        "invoiceDetails",
        "invoiceNumber"
      ],
      "displayOrderIndex": 0
    }
  ],
  "filters": [
    {
      "columnName": "Invoice Amount",
      "filterType": "equals_string",
      "string": "INV-123",
      "number": 1000
    }
  ],
  "aggregations": [
    {
      "name": "Total Revenue",
      "function": "count",
      "aggregateColumnName": "Invoice Amount",
      "groupByColumnName": "Customer Name"
    }
  ],
  "functions": [
    {
      "id": "string",
      "name": "string"
    }
  ]
}