202 Accepted immediately and the
outcome arrives by webhook (or by polling
GET /v2/calls/{id}).
Base URL https://sandbox.voice.miraiminds.co.
The call object
Statuses
Statuses only move forward. A terminal status never changes.
Ended reasons
ended_reason explains why a terminal status was reached. Match on status
for control flow; use ended_reason for analytics and support.
Treat
ended_reason as an open vocabulary. New values are added without a
version bump — always have a default branch. The last two rows above are in the
vocabulary but no call emits them today; they arrive with the warm-transfer
rollout and the t3/t5 tiers — see the roadmap.Create a call
Request
- cURL
- Python
- Node.js
202 Accepted
202 means the call is admitted to the queue — the phone has not rung yet.
The full call object is available from GET /v2/calls/{id}.
Errors
Variables
variables is a flat map of string keys to string values. Each key replaces the
matching {{key}} placeholder in the agent’s system_prompt and
first_message.
- Plain
{{key}}placeholders match loosely: letters and digits only, case-insensitive, so{{Customer Name}},{{customer_name}}and{{CustomerName}}all read the same variable. Only a Liquid expression with a filter ({{ key | upcase }}) needs the exact key. - A placeholder with no matching variable is substituted with an empty string —
it does not error, and it does not leave
{{braces}}for the agent to read aloud. Validate on your side. - Keep values short. They are part of the prompt, and the prompt is on the latency path.
- Variables are static per call. There is no way to change them mid-call.
Idempotency
SendIdempotency-Key with a value derived from your own domain object:
409 duplicate_call. It means “already in flight, no
second call placed” — retry a moment later and you will get the original
response, or wait for the webhook.
Get a call
- cURL
- Python
- Node.js
200 OK — the call object. 404 not_found for an
unknown ID, and for an ID that belongs to another workspace — the two are
deliberately indistinguishable.
Get the transcript
200 OK
404 not_found while the call is still running, and for a call that produced no
speech at all. Check transcript_available on the
call object if you want to tell those apart from a mistyped
id.
404 Not Found
Get the recording
302 to a signed, time-limited URL for the call’s audio (WAV). Follow the
redirect — most HTTP clients do by default; curl needs -L.
302 Found
404 not_found while the call is running, for a call that produced no audio, and
for one whose audio was never stored. recording_available on the call object
tells you which requests are worth making.
Transcripts and recordings are kept for 90 days, the same as the call
record. Pull anything you need to keep longer into your own system.
Abort a call
queued,
dialing or in_progress — a live call is hung up on the SIP server
mid-conversation, not merely flagged. Only a call that has already reached a
terminal status is refused: there is nothing left to stop.
202 Accepted
202 means the cancel was signalled. The call reaches aborted shortly after
with ended_reason: "aborted-by-api", and a
call.aborted event fires. An aborted call is never
billed — including one aborted after media went live.
List calls
200 OK
The list endpoint is for reconciliation and reporting, not for driving your
application state. For that, use webhooks.