Create Classifier Label
POSThttps://api.confident-ai.com/v1/classifiers/{classifierId}/labels
Adds a label to a classifier. The description is what the classifying model matches against, so write it as a clear statement of when the label applies rather than a restatement of the name. Label names are unique within a classifier. Requires the Starter plan or above.
curl -X POST "https://api.confident-ai.com/v1/classifiers/{classifierId}/labels" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Billing question",
"description": "User is asking about invoices, charges, or their subscription.",
"polarity": "NEUTRAL"
}'{
"success": true,
"data": {
"id": "LABEL-ID"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/workflows"
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
classifierIdstringRequiredThe unique identifier of the classifier to add the label to.
Request body
enabledbooleanWhether the label can be applied. Defaults to true.
statusenumSetting
ACTIVEalso enables the label, so sendingenabledfalse alongside it is rejected. Defaults toACTIVE.Show 2 enum valuesHide 2 enum values
RECOMMENDEDACTIVE
polarityenumWhether more of this label is good, bad, or neither. Defaults to
NEUTRAL.Show 3 enum valuesHide 3 enum values
HIGHER_IS_BETTERLOWER_IS_BETTERNEUTRAL
namestringRequiredThe label's name, unique within the classifier.
descriptionstringRequiredWhen this label applies. Required, and cannot be empty — it is the instruction the classifying model reads.
Response
successbooleanIndicates if the label was successfully created.
dataobjectShow 1 propertyHide 1 property
idstringThe unique identifier of the created label.
linkstringA link to the workflows page.