Launch Week 02 wrapped — explore all five launches

Query Dashboard Data

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

Fetches computed data for all widgets on a dashboard, or for a provided subset of widget IDs. Request time range fields override widget defaults for this query only.

POST/v1/dashboards/{dashboardId}/query
curl -X POST "https://api.confident-ai.com/v1/dashboards/{dashboardId}/query" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "startTime": "2024-01-01T00:00:00.000Z",
  "endTime": "2024-01-31T23:59:59.999Z",
  "granularity": "day",
  "widgetIds": [
    "WIDGET-ID"
  ]
}'
200
{
  "success": true,
  "data": {
    "results": [
      {
        "widgetId": "WIDGET-ID",
        "status": "ok",
        "type": "LINE",
        "mode": "TIME_SERIES",
        "kind": "TIME_SERIES",
        "unit": "COUNT",
        "xAxis": {
          "type": "time"
        },
        "series": [
          {
            "key": "Count",
            "name": "Count",
            "color": "BLUE",
            "lineId": "LINE-ID",
            "points": [
              {
                "x": "2024-01-01T00:00:00.000Z",
                "y": 42
              }
            ]
          }
        ]
      }
    ]
  },
  "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

    ISO 8601 start time for the query range. Must be provided with endTime.

  • endTimestring

    ISO 8601 end time for the query range. Must be provided with startTime.

  • granularityenum

    Optional bucket granularity override for the query.

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

    Optional subset of widget IDs to query. If omitted, all widgets on the dashboard are queried.

Response

The computed data for the requested dashboard widgets.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    The batch query payload.

    Show 1 propertyHide 1 property
    • resultslist of objects

      Computed data or error details for each queried widget.

      Show 12 propertiesHide 12 properties
      • widgetIdstring

        The id of the queried widget.

      • statusenum

        Whether this widget's batch query succeeded.

        Show 2 enum valuesHide 2 enum values
        • ok
        • error
      • typeenum

        The widget's visualization (display) type, echoed from its configuration. Does not determine which data fields are populated — use kind for that. Present when status is ok.

        Show 6 enum valuesHide 6 enum values
        • LINE
        • AREA
        • BAR
        • STACKED_BAR
        • TABLE
        • BIG_NUMBER
      • modeenum

        The widget's configured aggregation mode, echoed from its configuration. Branch on kind rather than mode when reading the data. Present when status is ok.

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

        The shape of the data in this result, and the field you should branch on when reading it. TIME_SERIES and DIMENSION populate series (with xAxis.type time and category respectively); BIG_NUMBER populates values; TABLE populates columns and rows. It is derived from type and mode, so it can differ from mode. Present when status is ok.

        Show 4 enum valuesHide 4 enum values
        • TIME_SERIES
        • DIMENSION
        • BIG_NUMBER
        • TABLE
      • unitenum

        Unit for the returned values, when applicable.

        Show 6 enum valuesHide 6 enum values
        • COUNT
        • PERCENT
        • SCORE
        • SECONDS
        • USD
        • MILLISECONDS
      • xAxisobject

        Present for TIME_SERIES and DIMENSION results.

        Show 1 propertyHide 1 property
        • typeenum

          Axis type for the returned data.

          Show 2 enum valuesHide 2 enum values
          • time
          • category
      • serieslist of objects

        Present for TIME_SERIES and DIMENSION results.

        Show 5 propertiesHide 5 properties
        • keystring

          Stable key that uniquely identifies this series within the result. Use it to correlate series across queries or as a render key.

        • namestring

          Display name for the series.

        • colorstring

          Display color for the series.

        • lineIdstring

          The line id that produced this series, when applicable.

        • pointslist of objects

          Points in this series.

          Show 2 propertiesHide 2 properties
          • xstring

            Time bucket start or category label.

          • ynumber

            Numeric value for the series at this point, or null when no data is available.

      • valueslist of objects

        Present for BIG_NUMBER results.

        Show 5 propertiesHide 5 properties
        • keystring

          Stable key that uniquely identifies this value within the result.

        • namestring

          Display name for the value.

        • colorstring

          Display color for the value.

        • lineIdstring

          The line id that produced this value, when applicable.

        • valuenumber

          Scalar value, or null when no data is available.

      • columnslist of objects

        Column definitions for TABLE results. The first column is the dimension (key dimension); the remaining columns are one per line, keyed by the line's name.

        Show 2 propertiesHide 2 properties
        • keystring

          Stable column key. Read each row's value for this column as row[key].

        • labelstring

          Display label for the column.

      • rowslist of objects

        Present for TABLE results.

      • errorobject

        Present only when status is error.

        Show 2 propertiesHide 2 properties
        • codeenum

          Machine-readable query error code.

          Show 1 enum valueHide 1 enum value
          • QUERY_FAILED
        • messagestring

          Human-readable query error message.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI