Launch Week 02 wrapped — explore all five launches

Create Classifier

POSThttps://api.confident-ai.com/v2/classifiers

Creates a classifier that tags incoming traces or threads with labels, and returns its id. A name is unique per data model within the project. Sending 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 a generation run next. Retrieve the classifier by id to read back what the preset seeded. Requires the Starter plan or above.

POST/v2/classifiers
curl -X POST "https://api.confident-ai.com/v2/classifiers" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Sentiment",
  "dataModel": "TRACE",
  "preset": "CUSTOM",
  "description": "Analyzes the emotional tone of user interactions.",
  "enabled": true,
  "autoClassify": true,
  "filters": {
    "operator": "AND",
    "groups": [
      {
        "operator": "AND",
        "filters": [
          {
            "category": "Trace Name",
            "condition": "Is",
            "value": "checkout"
          }
        ]
      }
    ]
  },
  "autoGenerationConfig": {
    "summaryPrompt": "Analyze the user'\''s input to determine the emotional tone they express.",
    "nClusters": 3,
    "sampleSize": 200
  }
}'
200
{
  "success": true,
  "data": {
    "id": "<CLASSIFIER-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.

Request body

  • namestringRequired

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

  • dataModelenumRequired

    What kind of production item a classifier labels: TRACE labels individual traces, THREAD labels whole conversations. It is fixed when the classifier is created.

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

    A Confident AI template to seed a classifier from. SENTIMENT arrives with its labels ready; USE_CASES and ISSUES ship with none and expect a generation run next. CUSTOM seeds nothing.

    Show 4 enum valuesHide 4 enum values
    • CUSTOM
    • SENTIMENT
    • USE_CASES
    • ISSUES
  • descriptionstring | null

    What this classifier is for. Send null to clear it.

  • enabledboolean

    Whether the classifier runs at all. Defaults to true.

  • autoClassifyboolean

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

  • filtersobject | null

    A set of filter groups combined by a top-level operator. Each group combines its filter rows by its own operator, and each row matches one property, such as Name or User Id, against a value with a condition such as Is or Contains.

    Show 2 propertiesHide 2 properties
    • operatorenumRequired

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

      Show 2 propertiesHide 2 properties
      • operatorenumRequired

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

        Show 4 propertiesHide 4 properties
        • categoryenumRequired

          Show 80 enum valuesHide 80 enum values
          • User Id
          • Thread Id
          • Trace Uuid
          • Trace Name
          • Trace Version
          • Trace Status
          • Trace Tags
          • Trace
          • Span Uuid
          • Name
          • Span Name
          • Span Type
          • Span Status
          • Metrics Status
          • Error Status
          • Name
          • Model
          • Provider
          • Integration
          • Embedder
          • Chunk Size
          • Top-K
          • Hyperparameter
          • Dataset
          • Dataset Name
          • Test Run ID
          • Identifier
          • Test File
          • Status
          • Official
          • Evals Mode
          • Tests Passed
          • Tests Failed
          • Pass Rate
          • Fail Rate
          • Star Rating
          • Thumbs Rating
          • Explanation
          • Expected Output
          • Expected Outcome
          • Annotator
          • End User
          • Annotation Type
          • Annotation Name
          • Criteria
          • Annotation Date
          • Metric Score
          • Metric Status
          • Name
          • Metadata
          • Classifier
          • Metric
          • Metric Name
          • Trace Count
          • Test Case ID
          • Requested review from
          • Assigned to
          • Tags
          • Labels
          • Tools Called
          • Finalized
          • Golden ID
          • Ingestion Task
          • Latency
          • Environment
          • Review flag
          • Vulnerability
          • Vulnerability Type
          • Attack Method
          • Risk Category
          • Framework
          • Assessment ID
          • Prompt Alias
          • Prompt Version
          • Prompt Label
          • Prompt Commit Hash
          • Prompt
          • Annotations
          • Status Code
          • Actor Type
        • conditionenum | enum | enum | enum | enum | enum | enum | enum | enum | enumRequired

          Show 10 variantsHide 10 variants
          • enum

            Show 6 enum valuesHide 6 enum values
            • Is less than
            • Is equal or less than
            • Is greater than
            • Is equal or greater than
            • Is equal to
            • Does not equal
          • OR
          • enum

            Show 2 enum valuesHide 2 enum values
            • Has
            • Has not
          • OR
          • enum

            Show 2 enum valuesHide 2 enum values
            • Is
            • Is not
          • OR
          • enum

            Show 2 enum valuesHide 2 enum values
            • Is one of
            • Is not one of
          • OR
          • enum

            Show 4 enum valuesHide 4 enum values
            • Is
            • Is not
            • Is empty
            • Is not empty
          • OR
          • enum

            Show 2 enum valuesHide 2 enum values
            • Contains
            • Does not contain
          • OR
          • enum

            Show 3 enum valuesHide 3 enum values
            • Contains
            • Contains only
            • Does not contain
          • OR
          • enum

            Show 4 enum valuesHide 4 enum values
            • Has decreased by more than
            • Has decreased by less than
            • Has increased by more than
            • Has increased by less than
          • OR
          • enum

            Show 1 enum valueHide 1 enum value
            • Has changed from
          • OR
          • enum

            Show 1 enum valueHide 1 enum value
            • Is between
        • valuestring | number | list of stringsRequired

          Show 3 variantsHide 3 variants
          • string

          • OR
          • number

          • OR
          • list of strings

        • keystring

  • autoGenerationConfigobject | null

    How a generation run samples and clusters your traffic. Both summaryPrompt and nClusters 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.

Response

Create Classifier succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A reference to a classifier by its id.

    Show 1 propertyHide 1 property
    • idstring

      The id of the classifier, 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