---
title: "Classify what a customer message is asking for"
method: POST
path: "/v1/ai/chat/commerce-intent"
tags: ["chat:commerce-intent"]
---

# Classify what a customer message is asking for

`POST /v1/ai/chat/commerce-intent`

## Request

- Base URL: `https://api.intura.co` (the document declares no server; this is the origin it was published from)
- URL: `https://api.intura.co/v1/ai/chat/commerce-intent`
- Auth: none declared

## Request body

- ModulesV1AiChatCommerceIntentSchemasClassifyRequest: One customer message to classify. `message` is required.
  - `message` string, required: The message to classify — WhatsApp, Instagram DM, marketplace chat, live chat, any of them. Bounded by the module's MAX_CHARS.
  - `history` string[], nullable: Previous turns in the conversation, oldest first. The last 4 are read. Worth sending: intent is often only decidable against the turn before it — 'yang merah aja' is an order if a choice was being offered and a product question if it was not.
  - `channel` string, nullable: Where the message arrived — `whatsapp`, `instagram`, `tokopedia`, `shopee`, `web`. Recorded, not scored: the corpus keeps it beside the text rather than in it, so no model reads it and it never moves a class. Send it so your own logs carry it.
  - `thresholds` object, nullable: Move the routing check for this one call: `route` (default 0.62), the probability the top class must clear, and `margin` (default 0.1), the lead it must hold over the runner-up. Either alone is fine; the other keeps Intura's default.

## Response `200`

Successful Response

- ModulesV1AiChatCommerceIntentSchemasClassifyResponse
  - `status` string: Always `success` on a 2xx
  - `code` integer: Mirrors the HTTP status code
  - `data` ModulesV1AiChatCommerceIntentSchemasClassifyResponseData, required: `data` for POST /v1/ai/chat/commerce-intent.
    - `label` string, required: `product`, `order`, `payment`, `shipping`, `complaint`, or `other`. Always `other` when `result.action` is `escalate`.
    - `score` number, required: The number this endpoint measured and decided on, 0..1, rounded to 4 dp — P(injection), P(scam), how strongly the frame reads as the card. Compare it against `thresholds` and you have `label`. This is the only number to threshold on; what it means on a given route is documented there.
    - `thresholds` object: The cuts this answer was decided by, after your saved settings and anything sent in `thresholds` on the request. Published on every response so a verdict can be compared with an older one: a score means nothing without the bar it was held to. Empty on an endpoint with nothing to tune.
    - `result` ModulesV1AiChatCommerceIntentSchemasClassifyResultData: `result` for a classification call: the spread, the check, and what to do.
      - `action` string, required: `route` — the class cleared both halves of the check (`thresholds.route` and `thresholds.margin`) and can be sent to its handler. `escalate` — it did not; send this message to a larger model or a person. This is the field to branch on.
      - `scores` object, required: Probability mass per class, summing to 1. Every class in `labels` appears, including the ones at zero.
      - `candidate` string, required: The class the model preferred, before the confidence check. Equal to `label` when `action` is `route`. Returned for logging and threshold tuning — never route on it.
      - `margin` number, required: Gap between the top class and the runner-up. The second half of the check: a top class that barely leads is a coin flip however high it scored. It had to be at least `thresholds.margin`.
      - `handling` string, required: One line describing what this class means and what a sensible handler does with it. Written for whoever is wiring the router.
      - `history_used` integer, required: How many previous turns were actually read. Two verdicts with different values here did not see the same evidence.
      - `languages` string[], required: The languages this message was read in: one trained model per language. Every supported language when none could be identified.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/intura/apis/intura-ai-api.md) - [All operations](https://skmtc.dev/intura/apis/intura-ai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/intura/apis/intura-ai-api/revisions/7cb6af4c6390?raw)
