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.
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>"
]
}'{
"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_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
dashboardIdstringRequiredThe id of the dashboard.
Request body
startTimestringThe 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.endTimestringThe end of the range to compute over, as an ISO 8601 datetime. Must be sent together with
startTime, and must be later than it.granularityenumThe 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_minuteshourdayweekmonth
widgetIdslist of stringsThe widgets to compute. Omit it to compute every widget on the dashboard.
Response
Query Dashboard succeeded.
successbooleanIndicates if the request was successful.
dataobjectThe computed data for the widgets of one dashboard.
Show 1 propertyHide 1 property
resultslist of object | objectOne entry per widget the query covered.
Show 2 variantsHide 2 variants
Dashboard Widget Query SuccessobjectA widget of the dashboard that Confident AI computed.
Show 5 propertiesHide 5 properties
widgetIdstringThe id of the widget this result was computed for.
typeenum | nullThe 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
TABLEwidget returns tabular data whatever itsmodeis.Show 7 enum valuesHide 7 enum values
LINEAREABARSTACKED_BARGROUPED_BARTABLEBIG_NUMBER
modeenum | nullHow a widget aggregates its lines.
TIME_SERIESplots each configured line over time;DIMENSION_SERIEStakes a single metric and splits it into one series per value of the widget'sdimension. This is the widget's saved configuration — the shape of a query response is given bykindon the result.Show 2 enum valuesHide 2 enum values
TIME_SERIESDIMENSION_SERIES
statusenumMarks the widget as computed.
Show 1 enum valueHide 1 enum value
OK
dataobject | object | object | objectA widget's computed data. Branch on
kindto read it: Confident AI derives the shape from the widget'stypeandmode, so aDIMENSION_SERIESwidget drawn as aTABLEreturnsTABLEdata.Show 4 variantsHide 4 variants
Widget Big Number DataobjectThe whole query range aggregated to one figure per line, as a BIG_NUMBER widget draws it.
Show 3 propertiesHide 3 properties
kindenumMarks the result as a set of headline figures.
Show 1 enum valueHide 1 enum value
BIG_NUMBER
unitenum | nullThe unit a widget's values are measured in.
Show 6 enum valuesHide 6 enum values
COUNTPERCENTSCORESECONDSUSDMILLISECONDS
valueslist of objectsOne figure per line on the widget.
- OR
Widget Time Series DataobjectValues bucketed over the query range, each point's
xthe start of its time bucket.Show 3 propertiesHide 3 properties
kindenumMarks the result as series plotted against time.
Show 1 enum valueHide 1 enum value
TIME_SERIES
unitenum | nullThe unit a widget's values are measured in.
Show 6 enum valuesHide 6 enum values
COUNTPERCENTSCORESECONDSUSDMILLISECONDS
serieslist of objectsOne series per line, or per dimension value when the widget breaks its single line down.
- OR
Widget Dimension DataobjectThe whole query range aggregated per dimension value, as a DIMENSION_SERIES widget draws it.
Show 3 propertiesHide 3 properties
kindenumMarks the result as series plotted against a dimension.
Show 1 enum valueHide 1 enum value
DIMENSION
unitenum | nullThe unit a widget's values are measured in.
Show 6 enum valuesHide 6 enum values
COUNTPERCENTSCORESECONDSUSDMILLISECONDS
serieslist of objectsOne series per line, each point's
xa value of the widget's dimension.
- OR
Widget Table DataobjectThe whole query range aggregated into a table, as a TABLE widget draws it.
Show 3 propertiesHide 3 properties
kindenumMarks the result as columns and rows.
Show 1 enum valueHide 1 enum value
TABLE
columnslist of objectsThe table's columns: the widget's dimension first, under the key
dimension, then one column per line.rowslist of objectsOne row per dimension value. Each row holds its values under the
keyof the column they belong to, and a value is null where the row had nothing to aggregate.
- OR
Dashboard Widget Query FailureobjectA 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
widgetIdstringThe id of the widget this result was computed for.
statusenumMarks the widget as failed.
Show 1 enum valueHide 1 enum value
ERROR
errorobjectWhy one widget of a dashboard query could not be computed.
Show 2 propertiesHide 2 properties
codeenumWhy the widget could not be computed.
Show 1 enum valueHide 1 enum value
QUERY_FAILED
messagestringA human-readable explanation of the failure.
deprecatedbooleanIndicates if this endpoint is deprecated.