Server
Flows
Create, read, update and delete your flows from code, and rotate their keys.
Flows you create here are the same as flows made in the dashboard: they appear there, and the dashboard creates its flows the same way.
Before you begin
You need:
- A server client made with your account key. See Server SDK.
Create a flow
Create a flow with a name and a workflow:
const { flowKey } = await voxio.flows.create({ name: "Support", workflow: { start_node: "greet", nodes: { greet: { /* … */ } } }, webhookUrl: "https://example.com/voxio", stt: { service: "deepgram", model: "nova-3" }, tts: { service: "elevenlabs", voice: "VOICE_ID" }, runtime: { "warmup-agent": true },});
console.log(flowKey); // → vk_…Replace VOICE_ID with the voice to use, from your text-to-speech provider.
The new flow's key comes back as flowKey.
Flow settings
namestringrequired- The name shown in the dashboard. Required when you create a flow.
workflow{ start_node, nodes }- The conversation graph.
start_nodemust be one of thenodes. webhookUrlURL- Where session events are posted. See Webhooks. When you create a flow, it needs a
workflowtoo. stt{ service, … }- The speech-to-text provider and its settings.
tts{ service, … }- The text-to-speech provider and its settings.
facesarray- The avatar's expressions. See Talking avatar.
transitionsarray- The transitions between expressions.
processTypestring- How the flow processes speech.
visionobject- Camera understanding, for flows that can see.
runningVisionobject- Continuous camera understanding during a call.
runtimeobject- Any other flow setting, stored as given.
Read a flow
Read the whole flow, or only the fields you need:
const flow = await voxio.flows.get(flowKey);const some = await voxio.flows.get(flowKey, { keys: ["flow_name", "agent_id"] });Update a flow
Pass only the fields to change:
await voxio.flows.update(flowKey, { name: "Support (EN)", tts: { service: "deepgram", voice: "aura-2" },});Other fields keep their values. If you update faces without transitions, or the other way round, the one you leave out is kept. The next session uses the new settings; sessions already running aren't affected.
Rotate the key
Replace the flow's key:
const { flowKey: newKey } = await voxio.flows.rotateKey(flowKey);The old key stops working at once. Phone numbers and sessions stay with the flow.
Delete a flow
Delete the flow and see what went with it:
const { sessionsDeleted, numbersDetached } = await voxio.flows.delete(flowKey);Next steps
- Webhooks: receive each conversation on your server.
- Sessions and usage: read transcripts and usage for a flow.