API-Referenz / Intents

Intents

Die Endpoints der Gruppe Intents der Voiceland AI API, mit Parametern, Schemata und Beispielen mit curl.

Zuletzt aktualisiert:

Die Beschreibungen der Endpoints und der Felder erscheinen auf Englisch, genau so, wie die API sie ausliefert. Das ist Absicht: Sie lesen hier, was Sie auch in den Antworten sehen.

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.

Parameter

Name Ort Typ Erforderlich Beschreibung
name path string Ja 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.

Antworten

Code Beschreibung
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.

Beispielanfrage

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

Eine erfolgreiche Antwort liefert ein IntentCandidatesResponse.

Beispielantwort

{
  "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.

Parameter

Name Ort Typ Erforderlich Beschreibung
name path string Ja The agent.

Anfragetext

application/json Schema: IntentPromoteRequest

Feld Typ Erforderlich Beschreibung
action string
description string
hash string Ja
intent string Ja
target string

Antworten

Code Beschreibung
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.

Beispielanfrage

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.

Parameter

Name Ort Typ Erforderlich Beschreibung
name path string Ja The agent.
hash path string Ja The candidate's hash from the listing.

Antworten

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

Beispielanfrage

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.

Parameter

Name Ort Typ Erforderlich Beschreibung
name path string Ja The agent.

Antworten

Code Beschreibung
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.

Beispielanfrage

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

Eine erfolgreiche Antwort liefert ein IntentTaxonomyResponse.

Beispielantwort

{
  "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.

Parameter

Name Ort Typ Erforderlich Beschreibung
name path string Ja The agent.

Anfragetext

application/json Schema: IntentTaxonomyRequest

Feld Typ Erforderlich Beschreibung
enabled boolean Ja
items array of IntentWire Ja
threshold number
unknown_action string

Antworten

Code Beschreibung
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.

Beispielanfrage

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"
}'

Eine erfolgreiche Antwort liefert ein IntentTaxonomyResponse.

Beispielantwort

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

Schemata#

Error#

Error envelope returned for non-2xx responses.

Feld Typ Erforderlich Beschreibung
error object Ja

IntentCandidateWire#

Feld Typ Erforderlich Beschreibung
count integer Ja
first_seen string
hash string Ja
last_call_id string
last_seen string
nearest_intent string
nearest_score number
text string Ja

IntentCandidatesResponse#

Feld Typ Erforderlich Beschreibung
agent string Ja
items array of IntentCandidateWire Ja
threshold number Ja
threshold_source string Ja
truncated boolean Ja
tuning array of IntentThresholdRung Ja

IntentPromoteRequest#

Feld Typ Erforderlich Beschreibung
action string
description string
hash string Ja
intent string Ja
target string

IntentTaxonomyRequest#

Feld Typ Erforderlich Beschreibung
enabled boolean Ja
items array of IntentWire Ja
threshold number
unknown_action string

IntentTaxonomyResponse#

Feld Typ Erforderlich Beschreibung
agent string Ja
enabled boolean Ja
items array of IntentWire Ja
threshold number Ja
threshold_source string Ja
unknown_action string Ja

IntentThresholdRung#

Feld Typ Erforderlich Beschreibung
candidates integer Ja
threshold number Ja
turns integer Ja

IntentWire#

Feld Typ Erforderlich Beschreibung
action string Ja
description string
examples array of string
name string Ja
target string

Die Konsole

Diese Seiten sind schreibgeschützt. Der Testanruf, die API-Schlüssel und die aktuelle API-Referenz finden Sie in der Konsole, in der Ihr Konto angemeldet ist.

Konsole öffnen