Simulate a call through a flow
import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const flowSimulation = await mv.flows.simulate("flow_7Hk2Lm9Qp", { messages: [ "Hi, I'd like to book an appointment", "Tomorrow at 10", ],});console.log(flowSimulation);from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
flow_simulation = client.flows.simulate("flow_7Hk2Lm9Qp", { "messages": [ "Hi, I'd like to book an appointment", "Tomorrow at 10", ],})print(flow_simulation)curl -X POST https://api.morevoice.ai/v1/flows/flow_7Hk2Lm9Qp/simulate \ -H "Authorization: Bearer $MOREVOICE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "messages": [ "Hi, I'\''d like to book an appointment", "Tomorrow at 10" ]}'Runs a text-only call through the flow’s draft (or a published version) with the real flow engine and the assistant’s model, and answers what happened: the turns, the nodes entered, the actions (dry runs: no API or tool request is sent) and where the call stands. Send the caller’s lines as messages / message, keys as dtmf, silence as no_response. Continue the same simulation with sim_id (it lives 15 minutes). With a test key the models are mocks.
Send Accept: text/event-stream to receive the same simulation as Server-Sent Events while it runs: sim.started (sim_id, resumed, kind), then sim.node, sim.turn and sim.action (each with the fields of the matching FlowSimulation entry) in order, and last sim.done, whose data is this endpoint’s JSON answer; error ends a failed run. Closing the connection stops the simulation. A streamed answer counts against the key’s stream limit and is not stored for Idempotency-Key replays.
Try it in the API playground with a test-mode key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A flow ID (flow_…).
Header Parameters
Section titled “Header Parameters”The API version to use for this request. Defaults to the version the API key is pinned to.
Example
2026-11-01A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice.
Example
5f0c1e8a-7b2d-4c3e-9f1a-2b6d8e4c0a17Request Body
Section titled “Request Body”A simulated call (text only, no audio): start one, or continue it with sim_id. Test keys simulate on mock models; actions and tools are dry runs.
object
Keys the caller presses, in order (after messages, before message); the entry then completes.
One more caller line (after messages).
What the caller says, one line per turn, in order.
The caller stays silent (a no-response timeout).
Continue this simulation (the id of an earlier answer; it lives 15 minutes after its last turn). Default: a new one.
Simulate this published version. Default: the draft.
Example
{ "messages": [ "Hi, I'd like to book an appointment", "Tomorrow at 10" ]}Responses
Section titled “Responses”OK
A simulated call’s progress: this request’s turns, path and actions, and where the call stands.
object
Actions and tool calls during this request (dry runs).
object
Api, transfer, voicemail, operator, tool:<name>, …
object
A flow ID (prefix flow_).
The simulation’s ID: send it as sim_id to continue.
true in live mode, false in test mode.
The nodes entered during this request, in order.
object
The node’s v1 type (internal: a type outside the public subset).
The transition taken into the node (null at the start or for a global jump).
This request continued an existing simulation.
What was said during this request, in order.
object
The node that spoke (assistant lines) or listened (caller lines).
Script: a node’s fixed line; ai: the model’s reply; speech / keypad: the caller.
The call’s variables now (sensitive ones redacted).
object
Example
{ "actions": [], "coverage": { "node_count": 5, "node_pct": 60, "transition_count": 5, "transition_pct": 40, "unvisited_node_keys": [ "bye" ], "visited_node_keys": [ "start", "ask_id" ] }, "current_node_key": "ask_id", "end_reason": null, "ended": false, "flow_id": "flow_7Kp1Ns4Vy6Ab9Dg2Hj5Lm8", "id": "sim_7Hk2pQ9xZb4Lm8Nc3Rt6Vw", "livemode": false, "object": "flow_simulation", "path": [ { "from_node_key": null, "node_key": "start", "node_type": "start", "transition_key": null, "via": "start" }, { "from_node_key": "start", "node_key": "ask_id", "node_type": "question", "transition_key": "t_next", "via": "always" } ], "resumed": false, "turns": [ { "node_key": "start", "role": "assistant", "source": "script", "text": "Hello, you've reached Acme." }, { "node_key": "ask_id", "role": "customer", "source": "speech", "text": "Hi, I'd like to book an appointment" }, { "node_key": "ask_id", "role": "assistant", "source": "ai", "text": "Sure! What is your ID number?" } ], "variables": { "customer_id": null }}The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "parameter_missing", "doc_url": "https://docs.morevoice.ai/api/errors#parameter-missing", "message": "Missing required parameter: to.", "param": "to", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
No valid API key was sent.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "invalid_api_key", "doc_url": "https://docs.morevoice.ai/api/errors#invalid-api-key", "message": "Invalid API key.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "authentication_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The key may not do this (a missing scope, a plan limit, or a compliance block).
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "missing_scope", "doc_url": "https://docs.morevoice.ai/api/errors#missing-scope", "message": "This API key lacks the calls:write scope.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "permission_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
No object with this ID exists in this organisation and mode.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "resource_missing", "doc_url": "https://docs.morevoice.ai/api/errors#resource-missing", "message": "No such object: 'call_4Gk2'.", "param": "id", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "not_found" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request conflicts with the object’s state, or the Idempotency-Key was reused with other parameters.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "idempotency_mismatch", "doc_url": "https://docs.morevoice.ai/api/errors#idempotency-mismatch", "message": "This Idempotency-Key was already used with different parameters.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "idempotency_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
Too many requests, or no call capacity right now. Retry after the Retry-After delay.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "rate_limited", "doc_url": "https://docs.morevoice.ai/api/errors#rate-limited", "message": "Too many requests. Retry after 1 second.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "rate_limit_error" }}Headers
Section titled “Headers”Seconds to wait before retrying.
The request’s ID (req_…). Quote it when you contact support.
Something went wrong on MoreVoice’s side. Retry with the same Idempotency-Key.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "internal_error", "doc_url": "https://docs.morevoice.ai/api/errors#internal-error", "message": "Something went wrong on MoreVoice's side.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "api_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.