Dashboards

GET /dashboards

List the organization's dashboards. Each row carries a chart count; the charts themselves come from the dashboard's detail endpoint.

Requires the analytics:read permission.

Query Parameters

limitnumber

The number of records to return.

cursorstring

A pagination cursor. Fetch the next page by passing the nextCursor value from the previous response.

sortname | -name | createdAt | -createdAt

The sort order. Prefix a field with - to sort descending. Defaults to -createdAt.

filterstring

A JSON-encoded filter document, for example {"createdAt":{"$gte":"2025-01-01T00:00:00Z"}}. Filterable fields: id, name, createdAt. See Filtering for the syntax.

Request
curl \
  "https://api.cascade.dev/dashboards" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "string",
      "chartCount": 0,
      "isDefault": true,
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ],
  "nextCursor": "string"
}

POST /dashboards

Create an empty dashboard. Charts are created onto it with POST /saved-charts.

Requires the analytics:write permission.

Body Parameters

dataobjectrequired

The dashboard to create.

Request
curl \
  -X POST \
  "https://api.cascade.dev/dashboards" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "name": "string"
  }
}'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "string",
  "chartCount": 0,
  "isDefault": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

GET /dashboards/{id}

Get a single dashboard by ID, with its charts in reading order (by grid row, then column), ready to run against /analytics/query.

Requires the analytics:read permission.

Path Parameters

idstring (uuid)required

The ID of the dashboard.

Request
curl \
  "https://api.cascade.dev/dashboards/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "string",
  "chartCount": 0,
  "isDefault": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z",
  "charts": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "dashboardId": "550e8400-e29b-41d4-a716-446655440000",
      "name": "string",
      "resource": "reviews",
      "chartType": "stat",
      "query": {
        "measures": "...",
        "groupBy": "...",
        "granularity": "...",
        "filter": "...",
        "limit": "..."
      },
      "layout": {
        "x": "...",
        "y": "...",
        "w": "...",
        "h": "..."
      },
      "invalidReason": "string",
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ]
}

PUT /dashboards/{id}

Rename a dashboard, or make it the one the app opens by default. Promoting a default demotes the dashboard that held it. Positions are changed through the layout endpoint.

Requires the analytics:write permission.

Path Parameters

idstring (uuid)required

The ID of the dashboard to update.

Body Parameters

dataobjectrequired

The fields to update.

Request
curl \
  -X PUT \
  "https://api.cascade.dev/dashboards/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": {
    "name": "string",
    "isDefault": true
  }
}'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "string",
  "chartCount": 0,
  "isDefault": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

DELETE /dashboards/{id}

Delete a dashboard and every chart on it. Each deletion is recorded in the audit log.

Requires the analytics:write permission.

Path Parameters

idstring (uuid)required

The ID of the dashboard to delete.

Request
curl \
  -X DELETE \
  "https://api.cascade.dev/dashboards/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "string",
  "chartCount": 0,
  "isDefault": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

PUT /dashboards/{id}/layout

Replace the dashboard's whole grid layout in one write, so a drag session is one request. The payload has to place every chart on the dashboard exactly once, inside the 12 column grid.

Requires the analytics:write permission.

Path Parameters

idstring (uuid)required

The ID of the dashboard.

Body Parameters

dataobject[]required

Where every chart on the dashboard sits. The whole layout is replaced in one write, so one drag session is one request.

Request
curl \
  -X PUT \
  "https://api.cascade.dev/dashboards/550e8400-e29b-41d4-a716-446655440000/layout" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "data": [
    {
      "chartId": "550e8400-e29b-41d4-a716-446655440000",
      "x": 0,
      "y": 0,
      "w": 0,
      "h": 0
    }
  ]
}'
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "string",
  "chartCount": 0,
  "isDefault": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z",
  "charts": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "dashboardId": "550e8400-e29b-41d4-a716-446655440000",
      "name": "string",
      "resource": "reviews",
      "chartType": "stat",
      "query": {
        "measures": "...",
        "groupBy": "...",
        "granularity": "...",
        "filter": "...",
        "limit": "..."
      },
      "layout": {
        "x": "...",
        "y": "...",
        "w": "...",
        "h": "..."
      },
      "invalidReason": "string",
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ]
}