Launch Week 02 wrapped — explore all five launches

Query Dashboard

POSThttps://api.confident-ai.com/v2/dashboards/{dashboardId}/query

Computes the data behind every widget on a dashboard, or behind the subset named by widgetIds. A time range you send overrides each widget's own for this query only. Widgets are computed independently, so one that fails comes back with status ERROR while the rest still carry their data.

POST/v2/dashboards/{dashboardId}/query
curl -X POST "https://api.confident-ai.com/v2/dashboards/{dashboardId}/query" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "startTime": "2025-01-01T00:00:00.000Z",
  "endTime": "2025-01-31T23:59:59.999Z",
  "granularity": "thirty_minutes",
  "widgetIds": [
    "<WIDGET-ID>"
  ]
}'
200
{
  "success": true,
  "data": {
    "results": [
      {
        "widgetId": "<WIDGET-ID>",
        "type": "LINE",
        "mode": "TIME_SERIES",
        "status": "OK",
        "data": {
          "kind": "BIG_NUMBER",
          "unit": "COUNT",
          "values": [
            {
              "key": "Traces",
              "name": "Traces",
              "color": "AMBER",
              "lineId": "<LINE-ID>",
              "value": 3814
            }
          ]
        }
      }
    ]
  },
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • dashboardIdstringRequired

    The id of the dashboard.

Request body

  • startTimestring

    The start of the range to compute over, as an ISO 8601 datetime. Must be sent together with endTime, and overrides each widget's own range for this query only.

  • endTimestring

    The end of the range to compute over, as an ISO 8601 datetime. Must be sent together with startTime, and must be later than it.

  • granularityenum

    The size of each bucket in computed widget data. Left unset, Confident AI picks one from the length of the query range.

    Show 5 enum valuesHide 5 enum values
    • thirty_minutes
    • hour
    • day
    • week
    • month
  • widgetIdslist of strings

    The widgets to compute. Omit it to compute every widget on the dashboard.

Response

Query Dashboard succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    The computed data for the widgets of one dashboard.

    Show 1 propertyHide 1 property
    • resultslist of object | object

      One entry per widget the query covered.

      Show 2 variantsHide 2 variants
      • Dashboard Widget Query Successobject

        A widget of the dashboard that Confident AI computed.

        Show 5 propertiesHide 5 properties
        • widgetIdstring

          The id of the widget this result was computed for.

        • typeenum | null

          The visualization a widget is drawn as. It is how the widget is displayed and does not by itself decide the shape of a query response — a TABLE widget returns tabular data whatever its mode is.

          Show 7 enum valuesHide 7 enum values
          • LINE
          • AREA
          • BAR
          • STACKED_BAR
          • GROUPED_BAR
          • TABLE
          • BIG_NUMBER
        • modeenum | null

          How a widget aggregates its lines. TIME_SERIES plots each configured line over time; DIMENSION_SERIES takes a single metric and splits it into one series per value of the widget's dimension. This is the widget's saved configuration — the shape of a query response is given by kind on the result.

          Show 2 enum valuesHide 2 enum values
          • TIME_SERIES
          • DIMENSION_SERIES
        • statusenum

          Marks the widget as computed.

          Show 1 enum valueHide 1 enum value
          • OK
        • dataobject | object | object | object

          A widget's computed data. Branch on kind to read it: Confident AI derives the shape from the widget's type and mode, so a DIMENSION_SERIES widget drawn as a TABLE returns TABLE data.

          Show 4 variantsHide 4 variants
          • Widget Big Number Dataobject

            The whole query range aggregated to one figure per line, as a BIG_NUMBER widget draws it.

            Show 3 propertiesHide 3 properties
            • kindenum

              Marks the result as a set of headline figures.

              Show 1 enum valueHide 1 enum value
              • BIG_NUMBER
            • unitenum | null

              The unit a widget's values are measured in.

              Show 6 enum valuesHide 6 enum values
              • COUNT
              • PERCENT
              • SCORE
              • SECONDS
              • USD
              • MILLISECONDS
            • valueslist of objects

              One figure per line on the widget.

          • OR
          • Widget Time Series Dataobject

            Values bucketed over the query range, each point's x the start of its time bucket.

            Show 3 propertiesHide 3 properties
            • kindenum

              Marks the result as series plotted against time.

              Show 1 enum valueHide 1 enum value
              • TIME_SERIES
            • unitenum | null

              The unit a widget's values are measured in.

              Show 6 enum valuesHide 6 enum values
              • COUNT
              • PERCENT
              • SCORE
              • SECONDS
              • USD
              • MILLISECONDS
            • serieslist of objects

              One series per line, or per dimension value when the widget breaks its single line down.

          • OR
          • Widget Dimension Dataobject

            The whole query range aggregated per dimension value, as a DIMENSION_SERIES widget draws it.

            Show 3 propertiesHide 3 properties
            • kindenum

              Marks the result as series plotted against a dimension.

              Show 1 enum valueHide 1 enum value
              • DIMENSION
            • unitenum | null

              The unit a widget's values are measured in.

              Show 6 enum valuesHide 6 enum values
              • COUNT
              • PERCENT
              • SCORE
              • SECONDS
              • USD
              • MILLISECONDS
            • serieslist of objects

              One series per line, each point's x a value of the widget's dimension.

          • OR
          • Widget Table Dataobject

            The whole query range aggregated into a table, as a TABLE widget draws it.

            Show 3 propertiesHide 3 properties
            • kindenum

              Marks the result as columns and rows.

              Show 1 enum valueHide 1 enum value
              • TABLE
            • columnslist of objects

              The table's columns: the widget's dimension first, under the key dimension, then one column per line.

            • rowslist of objects

              One row per dimension value. Each row holds its values under the key of the column they belong to, and a value is null where the row had nothing to aggregate.

      • OR
      • Dashboard Widget Query Failureobject

        A widget of the dashboard that could not be computed. One widget failing does not fail the rest of the query.

        Show 3 propertiesHide 3 properties
        • widgetIdstring

          The id of the widget this result was computed for.

        • statusenum

          Marks the widget as failed.

          Show 1 enum valueHide 1 enum value
          • ERROR
        • errorobject

          Why one widget of a dashboard query could not be computed.

          Show 2 propertiesHide 2 properties
          • codeenum

            Why the widget could not be computed.

            Show 1 enum valueHide 1 enum value
            • QUERY_FAILED
          • messagestring

            A human-readable explanation of the failure.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI