Skip to main content
POST
/
intent-classify
Classify Intent
curl --request POST \
  --url https://api.usehandled.io/api/v1/ipaas/inference/intent-classify \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": "I placed an order yesterday but I want to cancel it now",
  "conversation_history": [
    {
      "role": "customer",
      "text": "Hi, I need some help with my order"
    },
    {
      "role": "agent",
      "text": "Of course! What can I help you with?"
    }
  ],
  "top_k": 3,
  "threshold": 0.05
}
'
{
  "request_id": "<string>",
  "message": "<string>",
  "predictions": [
    {
      "intent": "track_order",
      "confidence": 0.5
    }
  ],
  "top_intent": "track_order",
  "latency_ms": 123,
  "model_version": "<string>"
}

Authorizations

Authorization
string
header
required

API token from your Handled dashboard

Body

application/json
message
string
required

The customer message or text to classify

Maximum string length: 2048
conversation_history
object[]

Prior turns in the conversation for context

top_k
integer
default:1

Number of top intents to return

Required range: 1 <= x <= 5
threshold
number
default:0

Minimum confidence score to include in results

Required range: 0 <= x <= 1

Response

Successful classification

request_id
string

Unique identifier for the inference request

message
string

The input message that was classified

predictions
object[]

Ranked list of intent predictions

top_intent
enum<string>

The highest-confidence intent

Available options:
track_order,
cancel_order,
return_item,
refund_request,
product_inquiry,
change_address,
payment_issue,
complaint,
compliment,
other
latency_ms
integer

Server-side inference time in milliseconds

model_version
string

Version of the model used