Create Classifier
POSThttps://api.confident-ai.com/v1/classifiers
Creates a classifier that tags incoming traces or threads with labels. Classifiers run on TRACE and THREAD items only, and a name is unique per data model within the project.
Passing a preset seeds the classifier with a description, a generation config, and a starting set of labels; any field you send explicitly overrides what the preset would have set. SENTIMENT arrives with its labels ready, while USE_CASES and ISSUES ship with none and expect you to call the generate endpoint next. Retrieve the classifier by id to read back what the preset seeded. Requires the Starter plan or above.
curl -X POST "https://api.confident-ai.com/v1/classifiers" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Sentiment",
"dataModel": "TRACE",
"preset": "SENTIMENT"
}'{
"success": true,
"data": {
"id": "CLASSIFIER-ID"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/workflows"
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
descriptionstringWhat this classifier is for.
enabledbooleanWhether the classifier runs at all. Defaults to true.
autoClassifybooleanWhether incoming items are classified automatically as they arrive. Defaults to true.
filtersobjectA set of filter groups combined by a top-level operator.
Show 2 propertiesHide 2 properties
operatorenumRequiredHow filters or groups are combined.
Show 2 enum valuesHide 2 enum values
ANDOR
groupslist of objectsRequiredThe filter groups.
Show 2 propertiesHide 2 properties
operatorenumRequiredHow filters or groups are combined.
Show 2 enum valuesHide 2 enum values
ANDOR
filterslist of objectsRequiredThe filter rows in this group.
Show 4 propertiesHide 4 properties
categorystringRequiredThe property a filter row matches on (e.g. "Name", "User Id", "Model", "Metadata"). The set of valid values depends on the line's dataModel.
conditionenumRequiredThe comparison a filter row applies. Valid conditions depend on the category.
Show 18 enum valuesHide 18 enum values
IsIs notIs equal toDoes not equalIs less thanIs equal or less thanIs greater thanIs equal or greater thanHasHas notContainsContains onlyDoes not containHas increased by more thanHas increased by less thanHas decreased by more thanHas decreased by less thanHas changed from
valuestring | number | list of stringsRequiredThe value to match against.
Show 3 variantsHide 3 variants
string
- OR
number
- OR
list of strings
keystringThe property key. Auto-populated from category when omitted; required for Metadata, Metric, and Classifier filters.
autoGenerationConfigobjectDrives label generation. Both required keys must be set before the generate endpoint will run.
Show 3 propertiesHide 3 properties
summaryPromptstringRequiredWhat the model should look for when clustering sampled traffic into themes.
nClustersintegerRequiredRoughly how many themes to cluster the sample into.
sampleSizeintegerHow many traces or threads to sample. Defaults to 200.
namestringRequiredThe classifier's name, unique per data model within the project.
dataModelenumRequiredWhat kind of item to classify. Cannot be changed later.
Show 2 enum valuesHide 2 enum values
TRACETHREAD
presetenumSeed the classifier from a template, which sets a description, a generation config, and a starting set of labels. Use
CUSTOM(or omit) to start empty.Show 4 enum valuesHide 4 enum values
CUSTOMSENTIMENTUSE_CASESISSUES
Response
successbooleanIndicates if the classifier was successfully created.
dataobjectShow 1 propertyHide 1 property
idstringThe unique identifier of the created classifier.
linkstringA link to the workflows page.