Saved Views API

A saved view stores one Explore configuration — model, dataset, measures, segments, filters, sort and chart settings — under a name, so an integration can recall the same question later. It always shows the latest data. Saved views are API only: the app has no picker for them (see Saved Views for what the app offers instead).

Saved views, saved filters or dashboards?

You want to… Use
Recall one query from your own code A saved view
Reuse a set of filter values in the app Saved Filters — on a dashboard, Filters → Save Current Filters; mark one Use Globally and it also appears in Explore's Add Filter picker. See Saved filters
Keep a visualization one click away in the app A dashboard — build it in Explore and use Add to Dashboard; its JSON is in the Dashboards API
Saved view Dashboard
Visualizations One Many
Layout None 12-column grid
Filters across several visualizations No Yes
Managed in the app No Yes

All endpoints require authentication and act on the workspace you call.

List views

Returns the authenticated user's own views plus any shared views in the workspace, limited to the data models the user's role can access.

GET /views

Response

{
  "views": [
    {
      "id": "a1b2c3d4-7e5f-4920-9a2b-12c3d4e5f678",
      "userId": "u1234abcd-7e5f-4920-9a2b-12c3d4e5f678",
      "name": "Monthly Revenue",
      "model": "ecommerce",
      "dataset": "orders",
      "viewType": "chart",
      "definition": { "metrics": [{ "property": "orders.revenue", "aggregation": "Sum" }], "timeSegments": [] },
      "shared": true,
      "own": true,
      "createdAt": 1711800000,
      "updatedAt": 1711800000
    }
  ]
}

own is true when you own the view. createdAt and updatedAt are epoch seconds.

Create a view

POST /views
Content-Type: application/json

Request body

Field Type Required Description
name string Yes Display name
model string Yes Model identifier
dataset string Yes Dataset identifier
viewType string Yes One of chart, table, metric
definition object Yes Query configuration (measures, conditions, segments, chart options)
shared boolean No If true, visible to all workspace users (default: false)

Example

{
  "name": "Top Countries by Revenue",
  "model": "ecommerce",
  "dataset": "orders",
  "viewType": "chart",
  "definition": {
    "metrics": [{ "property": "orders.revenue", "aggregation": "Sum" }],
    "segmentBy": ["orders.country"],
    "conditions": [],
    "chartType": "Cartesian"
  },
  "shared": false
}

Response (201)

{
  "id": "a1b2c3d4-7e5f-4920-9a2b-12c3d4e5f678",
  "name": "Top Countries by Revenue",
  "model": "ecommerce",
  "dataset": "orders",
  "viewType": "chart",
  "definition": { "metrics": [], "segmentBy": [], "conditions": [], "chartType": "Cartesian" },
  "shared": false,
  "createdAt": 1711800000
}

Update a view

Only the view owner can update it.

PUT /views/{id}
Content-Type: application/json

Request body

All fields are optional. Only provided fields are updated.

Field Type Description
name string New display name
definition object Updated query configuration
shared boolean Update sharing visibility

Response

{ "ok": true, "id": "a1b2c3d4-..." }

Delete a view

The view owner or a workspace admin can delete a view.

DELETE /views/{id}

Response

{ "ok": true }

Error responses

Status Meaning
400 Missing required fields or invalid viewType
401 Not authenticated
403 Not authorized (not the owner, or admin-only action)
404 View not found
← Dashboards APIHealth Checks →