Riferimento API / Omnichannel

Omnichannel

Gli endpoint del gruppo Omnichannel dell'API Voiceland AI, con parametri, schemi ed esempi curl.

Ultimo aggiornamento:

Le descrizioni degli endpoint e dei campi restano in inglese, esattamente come le pubblica l'API. È una scelta voluta: qui legge ciò che vedrà anche nelle risposte.

GET /v1/channel-kinds#

List channel kinds. The channel types you can configure.

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

curl "https://api.voiceland.ai/v1/channel-kinds" \
  -H "Authorization: Bearer VL_API_KEY"

Esempio di risposta

{
  "kinds": [
    "http",
    "slack",
    "telegram",
    "discord"
  ]
}

GET /v1/channels#

List channels. Your configured delivery channels.

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

curl "https://api.voiceland.ai/v1/channels" \
  -H "Authorization: Bearer VL_API_KEY"

Esempio di risposta

{
  "channels": []
}

DELETE /v1/channels/{name}#

Delete a channel. Deletes a channel.

Parametri

Nome Posizione Tipo Obbligatorio Descrizione
name path string Channel name.

Risposte

Codice Descrizione
204 Deleted.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

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

GET /v1/channels/{name}#

Get a channel. Returns one channel by name.

Parametri

Nome Posizione Tipo Obbligatorio Descrizione
name path string Channel name.

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

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

PUT /v1/channels/{name}#

Create or update a channel. Configures a delivery channel (webhook, chat platform, …).

Parametri

Nome Posizione Tipo Obbligatorio Descrizione
name path string Channel name.

Corpo della richiesta

application/json Schema: ChannelPutRequest

Campo Tipo Obbligatorio Descrizione
chat_id string
endpoint string Delivery endpoint (e.g. a webhook URL).
headers map of string
kind string Channel type (see /channel-kinds).
label string Human-readable label.
signing_key string
token string

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

curl -X PUT "https://api.voiceland.ai/v1/channels/{name}" \
  -H "Authorization: Bearer VL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "endpoint": "https://example.com/hook",
  "kind": "http",
  "label": "Ops"
}'

POST /v1/channels/{name}/test#

Test a channel. Sends a test delivery to the channel and returns the attempt result.

Parametri

Nome Posizione Tipo Obbligatorio Descrizione
name path string Channel name.

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

curl -X POST "https://api.voiceland.ai/v1/channels/{name}/test" \
  -H "Authorization: Bearer VL_API_KEY"

Esempio di risposta

{
  "channel": "ops-webhook",
  "http_status": 200
}

GET /v1/subscriptions#

List subscriptions. Your omnichannel event-routing rules.

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

curl "https://api.voiceland.ai/v1/subscriptions" \
  -H "Authorization: Bearer VL_API_KEY"

Esempio di risposta

{
  "subscriptions": []
}

DELETE /v1/subscriptions/{name}#

Delete a subscription. Deletes a subscription.

Parametri

Nome Posizione Tipo Obbligatorio Descrizione
name path string Subscription name.

Risposte

Codice Descrizione
204 Deleted.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

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

PUT /v1/subscriptions/{name}#

Create or update a subscription. Routes selected events to one or more channels, with an optional filter/schedule. A live subscription (no schedule, enabled) over call events is the real-time event webhooks capability; digests, disabled subscriptions, and live subscriptions that list only account alerts (kpi.*, calls.dial_cap_approaching, eval.drift_regression, report.ai_operations) or the chat takeover family (chat.takeover_*) are accepted on every plan.

Parametri

Nome Posizione Tipo Obbligatorio Descrizione
name path string Subscription name.

Corpo della richiesta

application/json Schema: SubscriptionPutRequest

Campo Tipo Obbligatorio Descrizione
actions array of SubscriptionAction
channels array of string Channel names that receive the events.
enabled boolean Whether the subscription is active.
event_types array of string Event types to route (e.g. call.hangup). Empty means all.
filter SubscriptionFilter
schedule string

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
402 A live, enabled subscription over call events needs real-time event webhooks (feature_not_entitled), or the account has no subscription (no_subscription). Disabling the subscription (enabled: false) is always accepted.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

curl -X PUT "https://api.voiceland.ai/v1/subscriptions/{name}" \
  -H "Authorization: Bearer VL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "channels": [
    "ops-webhook"
  ],
  "enabled": true,
  "event_types": [
    "call.hangup"
  ]
}'

GET /v1/text-agents#

List text agents. Your chat-only agents.

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

curl "https://api.voiceland.ai/v1/text-agents" \
  -H "Authorization: Bearer VL_API_KEY"

Esempio di risposta

{
  "text_agents": []
}

DELETE /v1/text-agents/{name}#

Delete a text agent. Deletes a text agent.

Parametri

Nome Posizione Tipo Obbligatorio Descrizione
name path string Text agent name.

Risposte

Codice Descrizione
204 Deleted.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

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

GET /v1/text-agents/{name}#

Get a text agent. Returns one text agent by name.

Parametri

Nome Posizione Tipo Obbligatorio Descrizione
name path string Text agent name.

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

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

PUT /v1/text-agents/{name}#

Create or update a text agent. Configures a chat-only agent.

Parametri

Nome Posizione Tipo Obbligatorio Descrizione
name path string Text agent name.

Corpo della richiesta

application/json Schema: TextAgent

Campo Tipo Obbligatorio Descrizione
allowed_channels array of string
greeting string
history_messages integer
max_output_tokens integer
model string
name string
provider string
system_prompt string
temperature number

Risposte

Codice Descrizione
200 Success.
401 Missing or invalid API key.
409 Creating this text agent would exceed your plan's agent allowance, one pool shared by voice and text agents, counted across your whole account (agent_limit). Updating an existing text agent is never refused for this reason.
4XX Request error (validation, not-found, etc.).
5XX Server or upstream error.

Esempio di richiesta

curl -X PUT "https://api.voiceland.ai/v1/text-agents/{name}" \
  -H "Authorization: Bearer VL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "greeting": "Hi! How can I help?",
  "name": "support-chat",
  "system_prompt": "You are Acme'\''s helpful support assistant. Answer questions about orders and shipping."
}'

Schemi#

ChannelPutRequest#

Configure a delivery channel.

Campo Tipo Obbligatorio Descrizione
chat_id string
endpoint string Delivery endpoint (e.g. a webhook URL).
headers map of string
kind string Channel type (see /channel-kinds).
label string Human-readable label.
signing_key string
token string

Error#

Error envelope returned for non-2xx responses.

Campo Tipo Obbligatorio Descrizione
error object

SubscriptionAction#

Campo Tipo Obbligatorio Descrizione
id string
label string
style string

SubscriptionFilter#

Campo Tipo Obbligatorio Descrizione
hangup_causes array of string

SubscriptionPutRequest#

Route events to channels.

Campo Tipo Obbligatorio Descrizione
actions array of SubscriptionAction
channels array of string Channel names that receive the events.
enabled boolean Whether the subscription is active.
event_types array of string Event types to route (e.g. call.hangup). Empty means all.
filter SubscriptionFilter
schedule string

TextAgent#

A chat-only (text) agent.

Campo Tipo Obbligatorio Descrizione
allowed_channels array of string
greeting string
history_messages integer
max_output_tokens integer
model string
name string
provider string
system_prompt string
temperature number

La console

Queste pagine sono di sola lettura. La chiamata di prova, le chiavi API e il riferimento API aggiornato si trovano nella console, dove il suo account è connesso.

Apri la console