Outbound calls

Make a call

Place one outbound call. POST /v1/calls · scope calls:write


The request

Tell us who runs the call (an agent), who to dial (toNumber), and your caller ID (fromNumber).

For the agent, send one of:

curl -X POST https://platform.eurekatechlabs.com/v1/calls \
  -H "Authorization: Bearer ek_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-9182-call" \
  -d '{
    "agentId":    "agt_xxxxxxxxxxxx",
    "toNumber":   "+919876543210",
    "fromNumber": "+918008001234",
    "clientRequestId": "order-9182",
    "overrides": {
      "firstMessage": "Hi, calling about your recent order.",
      "prompt": "Customer ordered SKU-4421 on May 20th."
    }
  }'
const res = await fetch('https://platform.eurekatechlabs.com/v1/calls', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ek_live_...',
    'Content-Type': 'application/json',
    'Idempotency-Key': 'order-9182-call',
  },
  body: JSON.stringify({
    agentId:    'agt_xxxxxxxxxxxx',
    toNumber:   '+919876543210',
    fromNumber: '+918008001234',
    clientRequestId: 'order-9182',
    overrides: {
      firstMessage: 'Hi, calling about your recent order.',
      prompt: 'Customer ordered SKU-4421 on May 20th.',
    },
  }),
});
const call = await res.json();
console.log(call.sessionId);
Field Required What
agentId one of these two A saved agent's id.
agent one of these two An inline agent config. See Inline agents.
toNumber yes The number to dial, E.164.
fromNumber yes Your caller ID. Must belong to your product.
clientRequestId no Your own reference, echoed back in the response and webhooks.
overrides no Tweak a saved agent for this one call: firstMessage and prompt only. Ignored with an inline agent. A welcome recording can't be overridden per call — it plays as configured.

Add an Idempotency-Key header to retry safely — see Authentication.


The response — `201`

{
  "sessionId": "ses_xxxxxxxxxxxxxxxxxx",
  "status": "initiated",
  "agentId": "agt_xxxxxxxxxxxx",
  "productId": "prd_xxxxxxxxxxxx",
  "clientRequestId": "order-9182"
}

Keep the sessionId — it's how you check or hang up the call. (agentId is null for inline calls.)


What a call goes through

initiated → ringing → in_progress → ended
                                  ↘ failed
Status Meaning
initiated We accepted it and queued the dial.
ringing The other phone is ringing.
in_progress Connected — the agent is talking.
ended Finished normally.
failed Couldn't connect, or dropped.

Errors

Status Code Meaning
400 VALIDATION_ERROR Missing/invalid field, or both agentId and agent sent.
402 INSUFFICIENT_BALANCE Wallet too low for one minute.
403 FORBIDDEN Key lacks calls:write.
409 CONFLICT Same Idempotency-Key already in progress.
502 PROVIDER_ERROR The phone provider rejected the call.

Next