Skip to main content
PATCH
/
v5
/
evaluation-dashboards
/
{dashboard_id}
/
widgets
/
{widget_id}
Update Dashboard Widget
curl --request PATCH \
  --url https://api.egp.scale.com/v5/evaluation-dashboards/{dashboard_id}/widgets/{widget_id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "title": "<string>",
  "query": {
    "select": [
      {
        "expression": {
          "column": "<string>",
          "type": "COLUMN"
        },
        "alias": "<string>"
      }
    ],
    "filter": {
      "conditions": [
        {
          "column": "<string>",
          "operator": "=",
          "value": "<unknown>"
        }
      ],
      "logicalOperators": [
        "AND"
      ]
    },
    "groupBy": [
      "<string>"
    ],
    "orderBy": [
      {
        "column": "<string>",
        "direction": "ASC"
      }
    ],
    "limit": 2
  },
  "config": {}
}
'
{
  "id": "<string>",
  "title": "<string>",
  "type": "bar",
  "account_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "object": "evaluation_widget",
  "query": {
    "select": [
      {
        "expression": {
          "column": "<string>",
          "type": "COLUMN"
        },
        "alias": "<string>"
      }
    ],
    "filter": {
      "conditions": [
        {
          "column": "<string>",
          "operator": "=",
          "value": "<unknown>"
        }
      ],
      "logicalOperators": [
        "AND"
      ]
    },
    "groupBy": [
      "<string>"
    ],
    "orderBy": [
      {
        "column": "<string>",
        "direction": "ASC"
      }
    ],
    "limit": 2
  },
  "config": {},
  "result": {
    "id": "<string>",
    "widget_id": "<string>",
    "computation_status": "<string>",
    "computed_result": {},
    "error_message": "<string>",
    "computed_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null

Path Parameters

dashboard_id
string
required
widget_id
string
required

Body

application/json
title
string

Widget title

Required string length: 1 - 256
query
SeriesQuery · object

Query that returns a series of records (used for table/bar/histogram widgets).

Used for widget types: table, bar, histogram. Returns: {"type": "series", "data": [...]}

Example SQL equivalent: SELECT category, AVG(score) as avg_score, COUNT(*) as count FROM evaluation_items WHERE score > 0.5 AND category = 'test' GROUP BY category ORDER BY avg_score DESC LIMIT 100

config
Config · object

Chart-specific display configuration

Response

Successful Response

Response model for widget creation - includes widget and computed result

id
string
required

Unique identifier of the widget

title
string
required

Widget title

type
enum<string>
required

Widget type

Available options:
bar,
histogram,
metric,
table,
markdown
account_id
string
required

Account that owns this widget

created_at
string<date-time>
required

When the widget was created

object
string
default:evaluation_widget
Allowed value: "evaluation_widget"
query
SeriesQuery · object

Query that returns a series of records (used for table/bar/histogram widgets).

Used for widget types: table, bar, histogram. Returns: {"type": "series", "data": [...]}

Example SQL equivalent: SELECT category, AVG(score) as avg_score, COUNT(*) as count FROM evaluation_items WHERE score > 0.5 AND category = 'test' GROUP BY category ORDER BY avg_score DESC LIMIT 100

config
Config · object

Display configuration

result
EvaluationWidgetResultResponse · object

Computed result for this widget