Update Rule
PUThttps://api.confident-ai.com/v2/evaluation-rules/{evaluationRuleId}
Updates an evaluation rule and returns it. Only the fields you send are changed; omitting a field leaves it untouched, and sending null clears it. Constraints are re-checked against the rule the update produces, not just the fields you sent, so switching a rule to THREAD still requires a multi-turn metric collection.
curl -X PUT "https://api.confident-ai.com/v2/evaluation-rules/{evaluationRuleId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Score production answers",
"enabled": false,
"dataModel": "TRACE",
"metricCollectionId": "<METRIC-COLLECTION-ID>",
"description": "Scores answers we serve to end users.",
"sampleRate": 0.2,
"spanType": "SPAN",
"filters": {
"operator": "AND",
"groups": [
{
"operator": "AND",
"filters": [
{
"category": "Name",
"condition": "Is",
"value": "capital-lookup"
}
]
}
]
},
"threadTimelimit": 300,
"overwriteEvals": false
}'{
"success": true,
"data": {
"id": "<EVALUATION-RULE-ID>",
"name": "Score production answers",
"description": "Scores answers we serve to end users.",
"enabled": true,
"sampleRate": 0.2,
"dataModel": "TRACE",
"spanType": "SPAN",
"filters": {
"operator": "AND",
"groups": [
{
"operator": "AND",
"filters": [
{
"category": "Name",
"condition": "Is",
"value": "capital-lookup"
}
]
}
]
},
"threadTimelimit": 300,
"overwriteEvals": false,
"metricCollectionId": "<METRIC-COLLECTION-ID>",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-20T08:00:00.000Z"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/workflows",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
evaluationRuleIdstringRequiredThe id of the evaluation rule.
Request body
namestringA new name for the rule, unique within the project.
enabledbooleanWhether the rule evaluates matching items as they arrive.
dataModelenumWhat kind of production item a rule evaluates: TRACE for a whole trace, SPAN for a single step within one, THREAD for a finished conversation.
Show 3 enum valuesHide 3 enum values
TRACESPANTHREAD
metricCollectionIdstringThe id of a different metric collection to run.
descriptionstring | nullA note about what the rule checks. Send null to clear it.
sampleRatenumberThe fraction of matching items to evaluate, between 0 and 1. Defaults to 1, all of them.
spanTypeenum | nullThe kind of work a span records: SPAN for a plain step, LLM for a model call, RETRIEVER for a knowledge-base lookup, TOOL for a tool call, and AGENT for an agent step.
Show 5 enum valuesHide 5 enum values
SPANAGENTTOOLRETRIEVERLLM
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
threadTimelimitintegerFor THREAD rules, the seconds of inactivity to wait before evaluating a thread, so an in-progress conversation is not scored halfway. Defaults to 300.
overwriteEvalsbooleanRe-evaluate items that already have results for this metric collection instead of skipping them. Defaults to false.
Response
Update Rule succeeded.
successbooleanIndicates if the request was successful.
dataobjectA standing rule that runs a metric collection against matching production traces, spans or threads as they arrive.
Show 13 propertiesHide 13 properties
idstringThe id of the rule, generated by Confident AI.
namestringThe name of the rule.
descriptionstring | nullA note about what the rule checks, or null when unset.
enabledbooleanWhether the rule is currently evaluating.
sampleRatenumberThe fraction of matching items the rule evaluates, between 0 and 1.
dataModelenumWhat kind of production item a rule evaluates: TRACE for a whole trace, SPAN for a single step within one, THREAD for a finished conversation.
Show 3 enum valuesHide 3 enum values
TRACESPANTHREAD
spanTypeenum | nullThe kind of work a span records: SPAN for a plain step, LLM for a model call, RETRIEVER for a knowledge-base lookup, TOOL for a tool call, and AGENT for an agent step.
Show 5 enum valuesHide 5 enum values
SPANAGENTTOOLRETRIEVERLLM
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 | enumShow 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 stringsShow 3 variantsHide 3 variants
string
- OR
number
- OR
list of strings
keystring
threadTimelimitintegerFor THREAD rules, the seconds of inactivity waited before a thread is evaluated.
overwriteEvalsbooleanWhether items that already have results for this metric collection are re-evaluated.
metricCollectionIdstringThe id of the metric collection the rule runs. Retrieve it from the metric collections endpoint to see the metrics it holds.
createdAtstringWhen the rule was created, as an ISO 8601 datetime.
updatedAtstringWhen the rule was last changed, as an ISO 8601 datetime.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.