Skip to main content
POST
/
calls
Trigger an outbound call
curl --request POST \
  --url https://api.dialnexa.com/v1/calls \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent_id": "agt_abc123",
  "to_phone_number": "+919876543210",
  "from_phone_number": "+912234567890",
  "agent_version_number": 3,
  "metadata": {
    "customer_name": "Priya Sharma",
    "account_id": "ACC-9912"
  }
}
'
{
  "id": "call_abc123",
  "to_phone_number": "+919876543210",
  "agent_id": "agt_abc123",
  "agent_version_number": 1,
  "status": "initiated",
  "created_at": "2024-03-01T10:00:00.000Z"
}
Initiates a single outbound call to the specified phone number using the given agent. The call starts as soon as the recipient answers.

When to use this

Use this when you need to make a single, immediate call, for example when triggering a follow-up after a form submission, sending a verification call, or making a click-to-call request from your CRM.

Destination validation

to_phone_number must be a valid international phone number. For non-SIP routes, the destination country and prefix must also be enabled in Workspace Settings > Telephony Config before the call is created. Invalid phone number formats return 400 Bad Request. Unsupported countries, unsupported prefixes, and workspaces with no enabled destination countries return 403 Forbidden.

Dynamic variables

Pass a metadata object to inject context into the agent’s prompt at call time. Reference these values in the prompt using {{variable_name}}:
{
  "agent_id": "agt_abc123",
  "to_phone_number": "+919876543210",
  "from_phone_number": "+912234567890",
  "metadata": {
    "customer_name": "Priya Sharma",
    "appointment_time": "3pm on Friday",
    "product": "Home Loan"
  }
}
In your prompt, you can then write: “Hi , calling to confirm your appointment.”

Response

Returns the call record with a call_id you can use to poll for status or fetch the transcript once the call completes.

Request

curl "https://api.dialnexa.com/v1/calls" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{...}'

Response

{
  "id": "call_x9y3zp4mq7r1",
  "status": "completed",
  "agent_id": "agt_k7m2nq9xw4p8",
  "to_phone_number": "+919876543210",
  "from_phone_number": "+912234567890",
  "duration_sec": 142,
  "created_at": "2024-05-01T14:22:00.000Z",
  "ended_at": "2024-05-01T14:24:22.000Z"
}

Authorizations

Authorization
string
header
required

Pass your API key as a Bearer token in the Authorization header.

Body

application/json
agent_id
string
required

ID of the agent to use for this call.

Example:

"agt_abc123"

to_phone_number
string
required

The number to dial, in E.164 format. Non-SIP routes must also pass workspace destination country and prefix validation.

Example:

"+919876543210"

from_phone_number
string

The caller ID to display. Must be a number purchased in your account.

Example:

"+912234567890"

agent_version_number
integer

Pin the call to a specific agent version. Defaults to the latest published version.

Example:

3

metadata
object

Key-value pairs injected as dynamic variables into the agent prompt at call time.

Example:
{
"customer_name": "Priya Sharma",
"account_id": "ACC-9912"
}

Response

Call initiated.

id
string
Example:

"call_abc123"

to_phone_number
string
Example:

"+919876543210"

agent_id
string
Example:

"agt_abc123"

agent_version_number
integer
Example:

1

status
enum<string>
Available options:
created,
initiated,
sent,
received,
completed,
did_not_pick,
busy,
no_answer,
failed,
cancelled,
retry_expired
Example:

"initiated"

created_at
string<date-time>
Example:

"2024-03-01T10:00:00.000Z"