Voice message routing

Route a customer's voice note — WhatsApp, voicemail or a call snippet — to the right team, with urgency and sentiment, using the Voice Message Routing template.

Goal: customers send voice notes. Dcision transcribes each one and decides where it goes — order status, refunds, complaints or sales — and escalates the urgent and the angry ones to a person.

Create the decision

Templates → Voice message routing → Create decision:

PartContent
Statevoice (audio, required), channel (string)
intentchoice — order_status, refund, complaint, sales, other; minimum confidence 0.6
urgentprobability — the customer needs an answer today
sentimentscore — angry, unhappy, neutral, happy
Policiesurgent ≥ 0.7 → escalate; sentiment = angry → escalate; fallback action escalate

voice is an audio field: OGG/Opus (WhatsApp), MP3, M4A, WAV, WebM and more. Dcision transcribes it with OpenAI, using your OpenAI key, and the engine answers about the transcript.

Call it

curl -X POST https://api.dcision.io/v1/decisions/voice-message-routing \
  -H "Authorization: Bearer $DCISION_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "state": {
      "voice": {"url":"https://example.com/voice-note.ogg","filename":"voice-note.ogg"},
      "channel": "whatsapp"
    }
  }'
200 OK (abridged)
{
  "schema": "voice-message-routing",
  "result": { "intent": "refund", "urgent": 0.81, "sentiment": "unhappy" },
  "action": "escalate",
  "action_reason": { "type": "policy", "rule": 0 },
  "metrics": { "input_files": 1, "input_processing_ms": 2140 }
}

The transcript is in the execution log (voice.text), and destinations can forward it with {{state.voice.text}}.

Act on it

const decision = await dcisionDecide("voice-message-routing", { voice: fileFromBytes(audio, "voice-note.ogg"), channel: "whatsapp" });
if (decision.action === "escalate") return assignToHuman(decision);
return routeToQueue(decision.result.intent, decision);

Tune it

  • Allow time: a minute of audio takes a few seconds to transcribe — give your HTTP client a 60 s timeout.
  • Add options for your own teams, and describe each one so near ties don't happen.
  • Test with real notes in the Playground: the Record button on audio fields sends your own voice.

On this page