Launch Week 02 wrapped — explore all five launches

Create Label

POSThttps://api.confident-ai.com/v2/classifiers/{classifierId}/labels

Adds a label to a classifier and returns its id. 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/v2/classifiers/{classifierId}/labels
curl -X POST "https://api.confident-ai.com/v2/classifiers/{classifierId}/labels" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Positive",
  "description": "User expresses satisfaction, gratitude, or positive sentiment.",
  "enabled": true,
  "status": "RECOMMENDED",
  "polarity": "HIGHER_IS_BETTER"
}'
200
{
  "success": true,
  "data": {
    "id": "<CLASSIFIER-LABEL-ID>"
  },
  "link": "https://app.confident-ai.com/project/<PROJECT-ID>/workflows",
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • classifierIdstringRequired

    The id of the classifier.

Request body

  • namestringRequired

    The name of the label, unique within the classifier.

  • descriptionstringRequired

    When this label applies. It is the instruction the classifying model reads, so state the condition rather than restating the name.

  • enabledboolean

    Whether the label can be applied. Defaults to true.

  • statusenum

    ACTIVE labels are in use; RECOMMENDED ones are generated suggestions awaiting review.

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

    Whether more of a signal is good, bad, or neither, for trend reporting.

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

Response

Create Label succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A reference to a classifier label by its id.

    Show 1 propertyHide 1 property
    • idstring

      The id of the label, generated by Confident AI.

  • linkstring

    This is the URL of the resource on the Confident AI platform.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI