Launch Week 02 wrapped — explore all five launches

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.

POST/v1/classifiers/{classifierId}/labels
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"
}'
200
{
  "success": true,
  "data": {
    "id": "LABEL-ID"
  },
  "link": "https://app.confident-ai.com/project/<PROJECT-ID>/workflows"
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • classifierIdstringRequired

    The unique identifier of the classifier to add the label to.

Request body

  • enabledboolean

    Whether the label can be applied. Defaults to true.

  • statusenum

    Setting ACTIVE also enables the label, so sending enabled false alongside it is rejected. Defaults to ACTIVE.

    Show 2 enum valuesHide 2 enum values
    • RECOMMENDED
    • ACTIVE
  • polarityenum

    Whether more of this label is good, bad, or neither. Defaults to NEUTRAL.

    Show 3 enum valuesHide 3 enum values
    • HIGHER_IS_BETTER
    • LOWER_IS_BETTER
    • NEUTRAL
  • namestringRequired

    The label's name, unique within the classifier.

  • descriptionstringRequired

    When this label applies. Required, and cannot be empty — it is the instruction the classifying model reads.

Response

  • successboolean

    Indicates if the label was successfully created.

  • dataobject

    Show 1 propertyHide 1 property
    • idstring

      The unique identifier of the created label.

  • linkstring

    A link to the workflows page.

Built byConfident AI