Launch Week 02 wrapped — explore all five launches

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.

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

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Request body

  • descriptionstring

    What this classifier is for.

  • enabledboolean

    Whether the classifier runs at all. Defaults to true.

  • autoClassifyboolean

    Whether incoming items are classified automatically as they arrive. Defaults to true.

  • filtersobject

    A set of filter groups combined by a top-level operator.

    Show 2 propertiesHide 2 properties
    • operatorenumRequired

      How filters or groups are combined.

      Show 2 enum valuesHide 2 enum values
      • AND
      • OR
    • groupslist of objectsRequired

      The filter groups.

      Show 2 propertiesHide 2 properties
      • operatorenumRequired

        How filters or groups are combined.

        Show 2 enum valuesHide 2 enum values
        • AND
        • OR
      • filterslist of objectsRequired

        The filter rows in this group.

        Show 4 propertiesHide 4 properties
        • categorystringRequired

          The property a filter row matches on (e.g. "Name", "User Id", "Model", "Metadata"). The set of valid values depends on the line's dataModel.

        • conditionenumRequired

          The comparison a filter row applies. Valid conditions depend on the category.

          Show 18 enum valuesHide 18 enum values
          • Is
          • Is not
          • Is equal to
          • Does not equal
          • Is less than
          • Is equal or less than
          • Is greater than
          • Is equal or greater than
          • Has
          • Has not
          • Contains
          • Contains only
          • Does not contain
          • Has increased by more than
          • Has increased by less than
          • Has decreased by more than
          • Has decreased by less than
          • Has changed from
        • valuestring | number | list of stringsRequired

          The value to match against.

          Show 3 variantsHide 3 variants
          • string

          • OR
          • number

          • OR
          • list of strings

        • keystring

          The property key. Auto-populated from category when omitted; required for Metadata, Metric, and Classifier filters.

  • autoGenerationConfigobject

    Drives label generation. Both required keys must be set before the generate endpoint will run.

    Show 3 propertiesHide 3 properties
    • summaryPromptstringRequired

      What the model should look for when clustering sampled traffic into themes.

    • nClustersintegerRequired

      Roughly how many themes to cluster the sample into.

    • sampleSizeinteger

      How many traces or threads to sample. Defaults to 200.

  • namestringRequired

    The classifier's name, unique per data model within the project.

  • dataModelenumRequired

    What kind of item to classify. Cannot be changed later.

    Show 2 enum valuesHide 2 enum values
    • TRACE
    • THREAD
  • presetenum

    Seed 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
    • CUSTOM
    • SENTIMENT
    • USE_CASES
    • ISSUES

Response

  • successboolean

    Indicates if the classifier was successfully created.

  • dataobject

    Show 1 propertyHide 1 property
    • idstring

      The unique identifier of the created classifier.

  • linkstring

    A link to the workflows page.

Built byConfident AI