Create Classifier
(v2)POST
Creates a classifier that tags incoming traces, spans or threads with labels, and returns its id. Sending a preset seeds it with a description, a generation config, and a starting set of labels; any field you send explicitly overrides what the preset would have set.
curl -X POST "https://api.confident-ai.com/v2/classifiers" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Sentiment",
"dataModel": "TRACE",
"preset": "CUSTOM",
"description": "Analyzes the emotional tone of user interactions.",
"enabled": true,
"autoClassify": true,
"includeAudio": false,
"filters": {
"operator": "AND",
"groups": [
{
"operator": "AND",
"filters": [
{
"category": "Trace Name",
"condition": "Is",
"value": "checkout"
}
]
}
]
},
"autoGenerationConfig": {
"sampleSize": 200
}
}'{
"success": true,
"data": {
"id": "<CLASSIFIER-ID>"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/workflows",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
namestringRequiredThe name of the classifier, unique per data model within the project.
dataModelenumRequiredWhat kind of production item a classifier labels:
TRACElabels individual traces,SPANlabels a span together with the spans under it,THREADlabels whole conversations. It is fixed when the classifier is created.Show 3 enum valuesHide 3 enum values
TRACESPANTHREAD
presetenumA Confident AI template to seed a classifier from.
SENTIMENTarrives with its labels ready;TOPICS,USE_CASESandISSUESship with none and expect a generation run next.CUSTOMseeds nothing.Show 5 enum valuesHide 5 enum values
CUSTOMSENTIMENTTOPICSUSE_CASESISSUES
descriptionstring | nullWhat this classifier is for. Send
nullto clear it.enabledbooleanWhether the classifier runs at all. Defaults to
trueon create; omit it on an update to leave it unchanged.autoClassifybooleanWhether incoming items are classified automatically as they arrive. Defaults to
trueon create; omit it on an update to leave it unchanged.includeAudiobooleanWhether the item's call recording and any audio in its inputs and outputs are sent to the classifier alongside the text, so it can catch issues that only show in the audio or in a mismatch between the audio and its transcript. Needs an audio-capable platform model. Defaults to
falseon create; omit it on an update to leave it unchanged.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
operatorenumRequiredHow the groups combine:
ANDmatches a record only when every group matches it, andORmatches it when any one group does.Show 2 enum valuesHide 2 enum values
ANDOR
groupslist of objectsRequiredThe groups of filters to apply, each combining its own filters with its own operator.
Show 2 propertiesHide 2 properties
operatorenumRequiredShow 2 enum valuesHide 2 enum values
ANDOR
filterslist of objectsRequiredShow 4 propertiesHide 4 properties
categoryenumRequiredShow 100 enum valuesHide 100 enum values
User IdCustomer IdCustomer NameThread IdTrace UUIDTrace NameTrace VersionTrace StatusTrace TagsTraceSpan UUIDNameSpan NameSpan TypeSpan StatusMetrics StatusError StatusCalled toolHanded off toHanded off byNearest parent of typeAnywhere underTop levelNameModelProviderIntegrationInput argumentEmbedderChunk SizeTop-KHyperparameterDatasetDataset NameTest Run IDIdentifierTest FileStatusOfficialEvals ModeTests PassedTests FailedPass RateFail RateStar RatingThumbs RatingExplanationExpected OutputExpected OutcomeAnnotatorEnd UserAnnotation TypeAnnotation NameAnnotation DateAnnotation RatingAnnotation ThumbsAnnotation ChoiceAnnotation Yes / NoAnnotation TextMetric ScoreMetric StatusMetric VersionNameMetadataClassifierClassifier VersionMetricMetric NameTrace CountTest Case IDRequested review fromAssigned toTagsLabelsTools CalledFinalizedGolden IDIngestion TaskLatencyEnvironmentReview flagVulnerabilityVulnerability TypeAttack MethodRisk CategoryFrameworkAssessment IDPrompt AliasPrompt VersionPrompt LabelPrompt Commit HashPromptAnnotationsFailure ModeRecommendedSub-mode NameSub-mode RecommendedSub-mode CertaintyStatus 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
autoGenerationConfigobject | nullHow many recent traces, spans or threads a generation run samples and classifies.
Show 1 propertyHide 1 property
sampleSizeintegerHow many traces, spans or threads to sample. Defaults to 200.
Response
Create Classifier succeeded.
successbooleanIndicates if the request was successful.
dataobjectA reference to a classifier by its id.
Show 1 propertyHide 1 property
idstringThe id of the classifier, generated by Confident AI.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.