Skip to main content
The /triage endpoint runs machine learning models to classify support tickets by category and priority, providing confidence scores for each prediction.

Endpoint

POST /api/v1/triage

Request Body

subject
string
required
The subject line of the support ticket to classify
body
string
required
The full body/description of the support ticket to classify

Response

category
string
required
The predicted category for the ticket (e.g., “Billing”, “Technical Support”, “Account Management”)
priority
string
required
The predicted priority level for the ticket (e.g., “High”, “Medium”, “Low”)
confidence
object
required
Confidence scores for each prediction

Example Request

curl -X POST "http://localhost:8000/api/v1/triage" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Cannot access my account",
    "body": "I have been trying to log in for the past hour but keep getting an error message. This is urgent as I need to access my dashboard."
  }'

Example Response

{
  "category": "Technical Support",
  "priority": "High",
  "confidence": {
    "category": 0.92,
    "priority": 0.87
  }
}

Use Cases

The triage endpoint is useful for:
  • Automatic ticket routing - Route tickets to the appropriate support team based on category
  • Priority queuing - Prioritize urgent tickets in the support queue
  • SLA management - Set response time expectations based on priority predictions
  • Analytics - Track common categories and priorities across support tickets

Model Training

The ML models used by this endpoint can be trained using the CLI:
uv run -m src.ml.train
Trained model artifacts are stored in the artifacts/ directory and automatically loaded when the API starts.

Confidence Scores

Confidence scores indicate how certain the model is about its predictions:
  • > 0.8 - High confidence, safe to use for automated routing
  • 0.6 - 0.8 - Medium confidence, consider human review
  • < 0.6 - Low confidence, recommend manual classification

Build docs developers (and LLMs) love