Skip to content
Discord

Calls

All call endpoints are workspace-scoped — send the workspace header.

POST /v2/call/initiate
FieldTypeRequiredDescription
phoneNumberstringyesE.164 recommended: +919876543210.
assistantstringyesAssistant _id.
payloadobjectnoValues for the assistant’s variables. Shape depends on the variant — see below.
callbackUrlstringnoHTTPS webhook URL.
prioritybooleannoJump the queue.
metadataobjectnoArbitrary object echoed back on every webhook event. Use it to correlate.
curl -X POST https://api.voice-agents.miraiminds.co/v2/call/initiate \
  -H "x-public-key: pk_1234567890abcdef1234567890abcdef" \
  -H "x-private-key: sk_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" \
  -H "workspace: 6690a1b2c3d4e5f600000002" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "+919876543210",
    "assistant": "68c128a658cd7d0668bce78d",
    "callbackUrl": "https://example.com/webhooks/call-events",
    "payload": {
      "customerName": "Jane Smith",
      "orderId": "ORD-12345",
      "orderValue": 2500
    },
    "metadata": { "internalOrderId": "8842" }
  }'
200 OK
{ "callId": "68f0a1b2c3d4e5f600000900", "status": "initiate" }
StatusCause
400Validation error
404Assistant not found

custom — a flat (or nested) object whose keys match the variables you declared in variant.config.inputSchema:

{
  "payload": {
    "orderId": "ORD-12345",
    "customerName": "Jane Smith",
    "orderValue": 2500,
    "status": "pending",
    "notes": "Customer requested callback"
  }
}

abandoned_cart — the Shopify abandoned-checkout object: id, abandonedCheckoutUrl, customer, lineItems, totalPriceSet, discountCodes, shippingAddress, and so on. Pass Shopify’s payload through largely unchanged.

There is no GET for a call in v1 — outcomes arrive by webhook only. If you need to read call state on demand, that is GET /v2/calls/{id} in v2.

Whatever you put here comes back on every event for that call:

{ "metadata": { "internalOrderId": "8842", "userId": "u_991" } }

Use it to join the webhook to your own records without keeping a callId table. v2 dropped metadata — correlate on call.id there.

POST /v2/call/web

Starts a browser-based call and returns a join token.

FieldTypeRequired
assistantstringyes
systemPromptstringno — overrides the assistant’s prompt for this call
payloadobjectno
metadataobjectno
201 Created
{ "success": true, "token": "eyJhbGciOiJIUzI1NiIs…", "error": null }

Note the 201 here versus 200 on /v2/call/initiate.

POST /v2/call/abort

The call ID goes in the body, not the path.

curl -X POST https://api.voice-agents.miraiminds.co/v2/call/abort \
  -H "x-public-key: pk_1234567890abcdef1234567890abcdef" \
  -H "x-private-key: sk_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" \
  -H "workspace: 6690a1b2c3d4e5f600000002" \
  -H "Content-Type: application/json" \
  -d '{ "callId": "68f0a1b2c3d4e5f600000900" }'
200 OK
{ "message": "Call aborted successfully" }

A bare message — no status_code, no data.

Allowed when the call has no status yet (initial queue) or is busy, failed, no-answer, rescheduled or validation-failed. Rejected with 400 when it is in-progress, completed, ended, timeout or already aborted.

StatusCause
400Already aborted, in progress, or completed
404Call not found

Aborting a retryable call is how you stop the whole retry chain — otherwise retryProtocol keeps dialling.

PUT /v2/call/{callId}

Replaces the payload of a call that has not been attempted yet.

curl -X PUT https://api.voice-agents.miraiminds.co/v2/call/68f0a1b2c3d4e5f600000900 \
  -H "x-public-key: pk_1234567890abcdef1234567890abcdef" \
  -H "x-private-key: sk_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef" \
  -H "workspace: 6690a1b2c3d4e5f600000002" \
  -H "Content-Type: application/json" \
  -d '{ "payload": { "customer": { "firstName": "Jane", "phone": "+919876543210" }, "orderId": "ORD-12345" } }'
200 OK
{ "status_code": 200, "message": "Call payload updated successfully." }

The payload is replaced, not merged. Send the whole object.

StatusCause
400Validation error, or the call is already in progress / completed
401Unauthorized
404Call not found
StatusMeaning
initiateQueued and being dialled.
in-progressAnswered; the conversation is running.
endedThe connection dropped.
completedRecording, transcript and duration processed.
timeoutExceeded maxCallDuration.
failedCould not connect.
validation-failedPre-call validation failed, e.g. an invalid number.
busyLine busy.
no-answerNobody picked up.
skipSkipped, e.g. a DND number.
rescheduledA callback is scheduled; the lifecycle continues.
abortedCancelled through the abort API.

Each status has a matching call.<status> webhook event.