Update Widget
PUThttps://api.confident-ai.com/v2/dashboards/{dashboardId}/widgets/{widgetId}
Replaces a widget's configuration and returns it. This is a full replacement: every field you leave out is cleared, apart from layout and lines, which keep what is stored until you send them. Sending lines replaces the widget's lines outright, so the returned lines have new ids.
curl -X PUT "https://api.confident-ai.com/v2/dashboards/{dashboardId}/widgets/{widgetId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Trace volume",
"description": "Traces served per day across production.",
"type": "LINE",
"unit": "COUNT",
"mode": "TIME_SERIES",
"bucketMode": "SERIES",
"dimension": "model",
"topK": {
"limit": 10,
"orderBy": "p90_latency",
"direction": "desc"
},
"startTime": "2025-01-01T00:00:00.000Z",
"endTime": "2025-01-31T23:59:59.999Z",
"layout": {
"x": 0,
"y": 0,
"w": 6,
"h": 2
},
"lines": [
{
"name": "Traces",
"color": "BLUE",
"dataModel": "TRACE",
"aggregation": "COUNT",
"filters": {
"operator": "AND",
"groups": [
{
"operator": "AND",
"filters": [
{
"category": "User Id",
"condition": "Is less than",
"value": "string",
"key": "string"
}
]
}
]
},
"extraQueryParams": {
"metricMetadataKey": "tokenCount"
}
}
]
}'{
"success": true,
"data": {
"id": "<WIDGET-ID>",
"name": "Trace volume",
"description": "Traces served per day across production.",
"type": "LINE",
"unit": "COUNT",
"mode": "TIME_SERIES",
"bucketMode": "SERIES",
"dimension": "project",
"topK": {
"limit": 10,
"orderBy": "p90_latency",
"direction": "desc"
},
"startTime": null,
"endTime": null,
"layout": {
"x": 0,
"y": 0,
"w": 6,
"h": 2
},
"lines": [
{
"id": "<LINE-ID>",
"name": "Traces",
"color": "AMBER",
"dataModel": "TRACE",
"aggregation": "AVG_COST",
"filters": {
"operator": "AND",
"groups": [
{
"operator": "AND",
"filters": [
{
"category": "User Id",
"condition": "Is less than",
"value": "string",
"key": "string"
}
]
}
]
},
"extraQueryParams": {}
}
]
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
dashboardIdstringRequiredThe id of the dashboard the widget is on.
widgetIdstringRequiredThe id of the widget.
Request body
namestringRequiredThe name shown as the widget's title.
descriptionstring | nullWhat the widget shows. Send null to leave it unset.
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
unitenum | nullThe unit a widget's values are measured in.
Show 6 enum valuesHide 6 enum values
COUNTPERCENTSCORESECONDSUSDMILLISECONDS
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
bucketModeenum | nullHow a widget's data is bucketed over the query time range.
SERIESsplits the range into one bucket pergranularityinterval;RANGEaggregates the whole range into a single bucket, as a BIG_NUMBER widget wants. Defaults toSERIES.Show 2 enum valuesHide 2 enum values
SERIESRANGE
dimensionenum | nullThe property a widget breaks its data down by, one series or table row per distinct value.
Show 26 enum valuesHide 26 enum values
projecttrace_namespan_namemodeltypethread_idtest_case_idtest_run_idend_usersourceannotatornameerrorprompt_aliastaglabelevaluation_modelprompt_versionprompt_labelprompt_commit_hashmetadatahyperparameterclassifierpolarityclassifier_labelversion
topKobject | nullCaps a dimension breakdown at the most interesting values, so a dimension with thousands of values still plots.
Show 3 propertiesHide 3 properties
limitintegerThe number of series or rows to keep, taking the highest or lowest by
orderBy. Defaults to 10.orderByenum | enumThe metric or column the dimension values are ranked by. Defaults to
count.Show 2 variantsHide 2 variants
enum
Show 28 enum valuesHide 28 enum values
countavg_latencyp50_latencyp90_latencyp99_latencyerror_ratepass_ratefailure_rateinput_costoutput_costtotal_costavg_costinput_tokensoutput_tokenstotal_tokenscount_distinct_endUserIdcount_distinct_threadIdcount_distinct_modelcount_distinct_projectIdcount_distinct_errorcount_distinct_metadataerror_countpass_countavg_scorestddev_scoremedian_scoreavg_ratingscore_histogram
- OR
enum
Show 3 enum valuesHide 3 enum values
created_atstart_timedimension
directionenumWhether to keep the highest ranked values or the lowest. Defaults to
desc.Show 2 enum valuesHide 2 enum values
ascdesc
startTimestring | nullThe start of the widget's own time range, as an ISO 8601 datetime. Send null to let the query decide the range.
endTimestring | nullThe end of the widget's own time range, as an ISO 8601 datetime. Send null to let the query decide the range.
layoutobject | nullA widget's position and size on the dashboard's 12-column grid. Omit it when creating a widget and Confident AI packs it into the first free space.
Show 4 propertiesHide 4 properties
xnumberRequiredThe widget's left edge, as a column index on the 12-column grid.
ynumberRequiredThe widget's top edge, as a row index on the grid.
wnumberRequiredThe widget's width in grid columns.
hnumberRequiredThe widget's height in grid rows.
linesarray | nullThe series the widget plots.
Show 6 propertiesHide 6 properties
namestringRequiredThe name the line is labelled with in the legend.
colorenum | nullThe colour a line is drawn in, from the Confident AI palette. A line you create without one is assigned the next colour in the palette.
Show 10 enum valuesHide 10 enum values
AMBERVIOLETEMERALDBLUEPINKCYANROSELIMETEALORANGE
dataModelenum | nullThe entity a widget line aggregates over. It decides which aggregations, filters and
extraQueryParamsthe line accepts.Show 12 enum valuesHide 12 enum values
TRACESPANLLM_SPANAGENT_SPANRETRIEVER_SPANTOOL_SPANCUSTOM_SPANTHREADEND_USERMETRIC_DATAANNOTATIONCLASSIFICATION
aggregationenum | nullThe aggregation a line computes, given as its token. Which tokens apply depends on the line's
dataModel—AVG_RATINGbelongs toANNOTATIONlines,TOTAL_TOKENSto span lines — and a token that does not apply to the line's data model is rejected with the list of the ones that do.Show 26 enum valuesHide 26 enum values
AVG_COSTAVG_COST_PER_USERAVG_LATENCYAVG_RATINGAVG_SCORECOUNTERROR_COUNTERROR_RATEFAILURE_RATEINPUT_COSTINPUT_TOKENSMEDIAN_SCORENEW_USERSOUTPUT_COSTOUTPUT_TOKENSP50_LATENCYP90_LATENCYP99_LATENCYPASS_RATERETENTIONTOTAL_COSTTOTAL_TOKENSUNIQUE_END_USERSUNIQUE_METADATA_VALUESUNIQUE_THREADSUNIQUE_USERS
filtersobject | nullA set of filter groups combined by a top-level operator. Each group combines its filter rows by its own operator, and each row matches one property, such as
NameorUser Id, against a value with a condition such asIsorContains.Show 2 propertiesHide 2 properties
operatorenumRequiredShow 2 enum valuesHide 2 enum values
ANDOR
groupslist of objectsRequiredShow 2 propertiesHide 2 properties
operatorenumRequiredShow 2 enum valuesHide 2 enum values
ANDOR
filterslist of objectsRequiredShow 4 propertiesHide 4 properties
categoryenumRequiredShow 80 enum valuesHide 80 enum values
User IdThread IdTrace UuidTrace NameTrace VersionTrace StatusTrace TagsTraceSpan UuidNameSpan NameSpan TypeSpan StatusMetrics StatusError StatusNameModelProviderIntegrationEmbedderChunk SizeTop-KHyperparameterDatasetDataset NameTest Run IDIdentifierTest FileStatusOfficialEvals ModeTests PassedTests FailedPass RateFail RateStar RatingThumbs RatingExplanationExpected OutputExpected OutcomeAnnotatorEnd UserAnnotation TypeAnnotation NameCriteriaAnnotation DateMetric ScoreMetric StatusNameMetadataClassifierMetricMetric NameTrace CountTest Case IDRequested review fromAssigned toTagsLabelsTools CalledFinalizedGolden IDIngestion TaskLatencyEnvironmentReview flagVulnerabilityVulnerability TypeAttack MethodRisk CategoryFrameworkAssessment IDPrompt AliasPrompt VersionPrompt LabelPrompt Commit HashPromptAnnotationsStatus CodeActor Type
conditionenum | enum | enum | enum | enum | enum | enum | enum | enum | enumRequiredShow 10 variantsHide 10 variants
enum
Show 6 enum valuesHide 6 enum values
Is less thanIs equal or less thanIs greater thanIs equal or greater thanIs equal toDoes not equal
- OR
enum
Show 2 enum valuesHide 2 enum values
HasHas not
- OR
enum
Show 2 enum valuesHide 2 enum values
IsIs not
- OR
enum
Show 2 enum valuesHide 2 enum values
Is one ofIs not one of
- OR
enum
Show 4 enum valuesHide 4 enum values
IsIs notIs emptyIs not empty
- OR
enum
Show 2 enum valuesHide 2 enum values
ContainsDoes not contain
- OR
enum
Show 3 enum valuesHide 3 enum values
ContainsContains onlyDoes not contain
- OR
enum
Show 4 enum valuesHide 4 enum values
Has decreased by more thanHas decreased by less thanHas increased by more thanHas increased by less than
- OR
enum
Show 1 enum valueHide 1 enum value
Has changed from
- OR
enum
Show 1 enum valueHide 1 enum value
Is between
valuestring | number | list of stringsRequiredShow 3 variantsHide 3 variants
string
- OR
number
- OR
list of strings
keystring
extraQueryParamsobject | nullAdvanced per-line query parameters, whose recognised keys depend on the line's
dataModel.spanTyperestricts aSPANline to one span type;metricMetadataKeynames the metadata field a span, trace or thread line aggregates;categoryandmetricNamepick out the metric aMETRIC_DATAline reads;dataTypeandsourcesay which annotations anANNOTATIONline counts. Unrecognised keys are ignored, and most lines send none of these.
Response
Update Widget succeeded.
successbooleanIndicates if the request was successful.
dataobjectOne chart on a dashboard, with the configuration a query computes it from.
Show 13 propertiesHide 13 properties
idstringThe id of the widget, generated by Confident AI.
namestringThe name shown as the widget's title.
descriptionstring | nullWhat the widget shows, or null when it has no description.
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
unitenum | nullThe unit a widget's values are measured in.
Show 6 enum valuesHide 6 enum values
COUNTPERCENTSCORESECONDSUSDMILLISECONDS
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
bucketModeenum | nullHow a widget's data is bucketed over the query time range.
SERIESsplits the range into one bucket pergranularityinterval;RANGEaggregates the whole range into a single bucket, as a BIG_NUMBER widget wants. Defaults toSERIES.Show 2 enum valuesHide 2 enum values
SERIESRANGE
dimensionenum | nullThe property a widget breaks its data down by, one series or table row per distinct value.
Show 26 enum valuesHide 26 enum values
projecttrace_namespan_namemodeltypethread_idtest_case_idtest_run_idend_usersourceannotatornameerrorprompt_aliastaglabelevaluation_modelprompt_versionprompt_labelprompt_commit_hashmetadatahyperparameterclassifierpolarityclassifier_labelversion
topKobject | nullCaps a dimension breakdown at the most interesting values, so a dimension with thousands of values still plots.
Show 3 propertiesHide 3 properties
limitintegerThe number of series or rows to keep, taking the highest or lowest by
orderBy. Defaults to 10.orderByenum | enumThe metric or column the dimension values are ranked by. Defaults to
count.Show 2 variantsHide 2 variants
enum
Show 28 enum valuesHide 28 enum values
countavg_latencyp50_latencyp90_latencyp99_latencyerror_ratepass_ratefailure_rateinput_costoutput_costtotal_costavg_costinput_tokensoutput_tokenstotal_tokenscount_distinct_endUserIdcount_distinct_threadIdcount_distinct_modelcount_distinct_projectIdcount_distinct_errorcount_distinct_metadataerror_countpass_countavg_scorestddev_scoremedian_scoreavg_ratingscore_histogram
- OR
enum
Show 3 enum valuesHide 3 enum values
created_atstart_timedimension
directionenumWhether to keep the highest ranked values or the lowest. Defaults to
desc.Show 2 enum valuesHide 2 enum values
ascdesc
startTimestring | nullThe start of the widget's own time range, or null when it has none.
endTimestring | nullThe end of the widget's own time range, or null when it has none.
layoutobject | nullA widget's position and size on the dashboard's 12-column grid. Omit it when creating a widget and Confident AI packs it into the first free space.
Show 4 propertiesHide 4 properties
xnumberThe widget's left edge, as a column index on the 12-column grid.
ynumberThe widget's top edge, as a row index on the grid.
wnumberThe widget's width in grid columns.
hnumberThe widget's height in grid rows.
lineslist of objectsThe series the widget plots.
Show 7 propertiesHide 7 properties
idstringThe id of the line, generated by Confident AI.
namestringThe name the line is labelled with in the legend.
colorenumThe colour a line is drawn in, from the Confident AI palette. A line you create without one is assigned the next colour in the palette.
Show 10 enum valuesHide 10 enum values
AMBERVIOLETEMERALDBLUEPINKCYANROSELIMETEALORANGE
dataModelenum | nullThe entity a widget line aggregates over. It decides which aggregations, filters and
extraQueryParamsthe line accepts.Show 12 enum valuesHide 12 enum values
TRACESPANLLM_SPANAGENT_SPANRETRIEVER_SPANTOOL_SPANCUSTOM_SPANTHREADEND_USERMETRIC_DATAANNOTATIONCLASSIFICATION
aggregationenum | nullThe aggregation a line computes, given as its token. Which tokens apply depends on the line's
dataModel—AVG_RATINGbelongs toANNOTATIONlines,TOTAL_TOKENSto span lines — and a token that does not apply to the line's data model is rejected with the list of the ones that do.Show 26 enum valuesHide 26 enum values
AVG_COSTAVG_COST_PER_USERAVG_LATENCYAVG_RATINGAVG_SCORECOUNTERROR_COUNTERROR_RATEFAILURE_RATEINPUT_COSTINPUT_TOKENSMEDIAN_SCORENEW_USERSOUTPUT_COSTOUTPUT_TOKENSP50_LATENCYP90_LATENCYP99_LATENCYPASS_RATERETENTIONTOTAL_COSTTOTAL_TOKENSUNIQUE_END_USERSUNIQUE_METADATA_VALUESUNIQUE_THREADSUNIQUE_USERS
filtersobject | nullA set of filter groups combined by a top-level operator. Each group combines its filter rows by its own operator, and each row matches one property, such as
NameorUser Id, against a value with a condition such asIsorContains.Show 2 propertiesHide 2 properties
operatorenumShow 2 enum valuesHide 2 enum values
ANDOR
groupslist of objectsShow 2 propertiesHide 2 properties
operatorenumShow 2 enum valuesHide 2 enum values
ANDOR
filterslist of objectsShow 4 propertiesHide 4 properties
categoryenumShow 80 enum valuesHide 80 enum values
User IdThread IdTrace UuidTrace NameTrace VersionTrace StatusTrace TagsTraceSpan UuidNameSpan NameSpan TypeSpan StatusMetrics StatusError StatusNameModelProviderIntegrationEmbedderChunk SizeTop-KHyperparameterDatasetDataset NameTest Run IDIdentifierTest FileStatusOfficialEvals ModeTests PassedTests FailedPass RateFail RateStar RatingThumbs RatingExplanationExpected OutputExpected OutcomeAnnotatorEnd UserAnnotation TypeAnnotation NameCriteriaAnnotation DateMetric ScoreMetric StatusNameMetadataClassifierMetricMetric NameTrace CountTest Case IDRequested review fromAssigned toTagsLabelsTools CalledFinalizedGolden IDIngestion TaskLatencyEnvironmentReview flagVulnerabilityVulnerability TypeAttack MethodRisk CategoryFrameworkAssessment IDPrompt AliasPrompt VersionPrompt LabelPrompt Commit HashPromptAnnotationsStatus CodeActor Type
conditionenum | enum | enum | enum | enum | enum | enum | enum | enum | enumvaluestring | number | list of stringskeystring
extraQueryParamsobject | nullAdvanced per-line query parameters, whose recognised keys depend on the line's
dataModel.spanTyperestricts aSPANline to one span type;metricMetadataKeynames the metadata field a span, trace or thread line aggregates;categoryandmetricNamepick out the metric aMETRIC_DATAline reads;dataTypeandsourcesay which annotations anANNOTATIONline counts. Unrecognised keys are ignored, and most lines send none of these.
deprecatedbooleanIndicates if this endpoint is deprecated.