Référence de l'API / Intents

Intents

Les endpoints du groupe Intents de l'API Voiceland AI, avec les paramètres, les schémas et des exemples curl.

Dernière mise à jour:

Les descriptions des endpoints et des champs restent en anglais, telles que l'API les publie. C'est un choix délibéré : vous lisez ici ce que vous verrez aussi dans les réponses.

GET /v1/agents/{name}/intent-candidates#

List intent candidates. What callers asked this agent for that its taxonomy does not cover, most frequent first. Each entry carries how often it recurred and which existing intent it came closest to, a high nearest_score usually means the fix is one more example on an intent you already have, not a new one. **Reading the scores.** threshold is the cut these phrasings failed to clear and threshold_source says whether you set it (agent) or the platform default applies (default). Every nearest_score here is below that number by definition, so the threshold is what makes the scores mean anything. **tuning is the what-if ladder.** Each rung is a lower threshold with how many of the phrasings BELOW, and how many turns they account for, would have been routed to their nearest_intent instead of landing here. It is computed over the rows in this response and nothing else, so you can check any rung by hand, and limit / min_count narrow it along with the feed. A phrasing with no nearest_intent is never counted on any rung: nothing scored against it, so no threshold recovers it and it needs a new intent. An empty ladder means exactly that for the whole page. Entries expire on their own after sixty days, so this is a review feed rather than an archive. truncated: true means the read stopped at its row budget and this is a top-N over the rows it reached.

Paramètres

Nom Emplacement Type Requis Description
name path string Oui The agent.
limit query integer Rows to return, 1-500 (default 50).
min_count query integer Drop phrasings heard fewer times than this. Use it to skip one-offs.

Réponses

Code Description
200 Success.
400 limit or min_count is not a whole number in range (bad_request).
401 Missing or invalid API key.
402 Your plan does not include intent recognition (feature_not_entitled).
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Exemple de requête

curl "https://api.voiceland.ai/v1/agents/{name}/intent-candidates" \
  -H "Authorization: Bearer VL_API_KEY"

Une réponse réussie renvoie un IntentCandidatesResponse.

Exemple de réponse

{
  "agent": "front-desk",
  "items": [
    {
      "count": 34,
      "hash": "9f2c1a7e4b3d4e219c0a5f6d7e8a9b0c",
      "nearest_intent": "billing_invoice",
      "nearest_score": 0.19,
      "text": "τι ωρα ανοιγετε σημερα"
    }
  ],
  "threshold": 0.35,
  "threshold_source": "default",
  "truncated": false,
  "tuning": [
    {
      "candidates": 0,
      "threshold": 0.3,
      "turns": 0
    },
    {
      "candidates": 0,
      "threshold": 0.25,
      "turns": 0
    },
    {
      "candidates": 0,
      "threshold": 0.2,
      "turns": 0
    },
    {
      "candidates": 1,
      "threshold": 0.15,
      "turns": 34
    },
    {
      "candidates": 1,
      "threshold": 0.1,
      "turns": 34
    },
    {
      "candidates": 1,
      "threshold": 0.05,
      "turns": 34
    }
  ]
}

POST /v1/agents/{name}/intent-candidates/promote#

Promote an intent candidate. Adds a mined phrasing to the taxonomy and drops it from the candidate list. Naming an EXISTING intent adds the phrasing as one more example, which is the usual move; naming a new one creates it and needs an action. The phrasing added is the one that was recorded, taken from the stored candidate rather than from this request, an edited version would not match the traffic it was promoted to cover.

Paramètres

Nom Emplacement Type Requis Description
name path string Oui The agent.

Corps de la requête

application/json Schéma : IntentPromoteRequest

Champ Type Requis Description
action string
description string
hash string Oui
intent string Oui
target string

Réponses

Code Description
200 Success.
400 hash or intent missing, or a new intent named without an action (invalid_request); or the resulting taxonomy is invalid (invalid_intents).
401 Missing or invalid API key.
404 No agent by that name (agent_not_found), or no candidate with that hash (candidate_not_found).
409 That phrasing is already an example on the named intent (example_exists).
422 The body is not valid JSON for this shape (invalid_request).
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Exemple de requête

curl -X POST "https://api.voiceland.ai/v1/agents/{name}/intent-candidates/promote" \
  -H "Authorization: Bearer VL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "action": "answer_from_kb",
  "hash": "9f2c1a7e4b3d4e219c0a5f6d7e8a9b0c",
  "intent": "opening_hours"
}'

DELETE /v1/agents/{name}/intent-candidates/{hash}#

Dismiss an intent candidate. Removes one mined phrasing from the candidate list without adding it to the taxonomy, "we are not going to cover this". Dismissing something callers keep saying only clears it until it is said again.

Paramètres

Nom Emplacement Type Requis Description
name path string Oui The agent.
hash path string Oui The candidate's hash from the listing.

Réponses

Code Description
204 Dismissed (or already gone).
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Exemple de requête

curl -X DELETE "https://api.voiceland.ai/v1/agents/{name}/intent-candidates/{hash}" \
  -H "Authorization: Bearer VL_API_KEY"

GET /v1/agents/{name}/intents#

Get an agent's intent taxonomy. The list of things this agent recognises callers asking for, and what it does with each. Never configured reads as disabled with an empty list and the platform default threshold. threshold is always the number actually in force, and threshold_source says where it came from: agent when you set one, default when the platform value applies.

Paramètres

Nom Emplacement Type Requis Description
name path string Oui The agent.

Réponses

Code Description
200 Success.
401 Missing or invalid API key.
402 Your plan does not include intent recognition (feature_not_entitled).
404 No agent by that name (agent_not_found).
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Exemple de requête

curl "https://api.voiceland.ai/v1/agents/{name}/intents" \
  -H "Authorization: Bearer VL_API_KEY"

Une réponse réussie renvoie un IntentTaxonomyResponse.

Exemple de réponse

{
  "agent": "front-desk",
  "enabled": true,
  "items": [
    {
      "action": "answer_from_kb",
      "examples": [
        "Why was I charged twice",
        "Θέλω να δω το τιμολόγιό μου"
      ],
      "name": "billing_invoice"
    }
  ],
  "threshold": 0.35,
  "threshold_source": "default",
  "unknown_action": "record"
}

PUT /v1/agents/{name}/intents#

Set an agent's intent taxonomy. Replaces the whole taxonomy. Every caller turn is then matched against it before the agent answers, and the match steers the answer according to that intent's action: answer_from_kb searches your knowledge base, flow runs a named procedure, tool calls a named tool, escalate_to_human offers a person, transfer hands the call on. **What matching is done on.** The examples are the evidence, write them in the words your callers actually use, in every language the agent answers in. description counts for less, and an intent with no examples matches poorly. **Turns that match nothing** are recorded as taxonomy candidates you can review and promote, and, only if unknown_action is fallback, answered with your agent's existing out-of-scope reply. Leave it on record until the taxonomy covers your traffic; fallback on a partial taxonomy makes the agent decline most of what it is asked. **threshold is per agent and worth tuning.** Omit it for the platform default of 0.35, which is deliberately conservative and is measurably strict on speech carrying a lot of filler: a clean in-scope ask scores 0.76 to 0.83 against a five-intent taxonomy, but the same asks spoken with ordinary greetings and thanks measure 0.19 to 0.30 and are recorded as unknown. Tune it from your own GET /agents/{name}/intent-candidates feed, whose tuning ladder says what each lower cut would have caught in your traffic; lowering it buys recall and costs precision, so move one rung at a time. Setting enabled: true requires the intent-recognition capability on your plan. A stored taxonomy with enabled: false costs nothing and is never matched.

Paramètres

Nom Emplacement Type Requis Description
name path string Oui The agent.

Corps de la requête

application/json Schéma : IntentTaxonomyRequest

Champ Type Requis Description
enabled boolean Oui
items array of IntentWire Oui
threshold number
unknown_action string

Réponses

Code Description
200 Success.
400 An action outside answer_from_kb/flow/tool/escalate_to_human/transfer, a flow or tool action with no target, a duplicate name, a threshold outside 0-1, or an off-vocabulary unknown_action (invalid_intents).
401 Missing or invalid API key.
402 enabled: true but your plan does not include intent recognition (feature_not_entitled).
404 No agent by that name (agent_not_found).
422 The body is not valid JSON for this shape (invalid_request).
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Exemple de requête

curl -X PUT "https://api.voiceland.ai/v1/agents/{name}/intents" \
  -H "Authorization: Bearer VL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true,
  "items": [
    {
      "action": "answer_from_kb",
      "description": "Questions about an invoice or a charge.",
      "examples": [
        "Why was I charged twice",
        "Θέλω να δω το τιμολόγιό μου"
      ],
      "name": "billing_invoice"
    },
    {
      "action": "escalate_to_human",
      "examples": [
        "Let me speak to a person",
        "Θέλω να μιλήσω με εκπρόσωπο"
      ],
      "name": "speak_to_human"
    }
  ],
  "threshold": 0.35,
  "unknown_action": "record"
}'

Une réponse réussie renvoie un IntentTaxonomyResponse.

Exemple de réponse

{
  "agent": "front-desk",
  "enabled": true,
  "items": [
    {
      "action": "answer_from_kb",
      "name": "billing_invoice"
    }
  ],
  "threshold": 0.35,
  "threshold_source": "agent",
  "unknown_action": "record"
}

Schémas#

Error#

Error envelope returned for non-2xx responses.

Champ Type Requis Description
error object Oui

IntentCandidateWire#

Champ Type Requis Description
count integer Oui
first_seen string
hash string Oui
last_call_id string
last_seen string
nearest_intent string
nearest_score number
text string Oui

IntentCandidatesResponse#

Champ Type Requis Description
agent string Oui
items array of IntentCandidateWire Oui
threshold number Oui
threshold_source string Oui
truncated boolean Oui
tuning array of IntentThresholdRung Oui

IntentPromoteRequest#

Champ Type Requis Description
action string
description string
hash string Oui
intent string Oui
target string

IntentTaxonomyRequest#

Champ Type Requis Description
enabled boolean Oui
items array of IntentWire Oui
threshold number
unknown_action string

IntentTaxonomyResponse#

Champ Type Requis Description
agent string Oui
enabled boolean Oui
items array of IntentWire Oui
threshold number Oui
threshold_source string Oui
unknown_action string Oui

IntentThresholdRung#

Champ Type Requis Description
candidates integer Oui
threshold number Oui
turns integer Oui

IntentWire#

Champ Type Requis Description
action string Oui
description string
examples array of string
name string Oui
target string

La console

Ces pages sont en lecture seule. L'appel de test, les clés API et la référence de l'API à jour se trouvent dans la console, où votre compte est connecté.

Ouvrir la console