Knowledge Center עברית Log in
Topics

How to place a call right away through the API

Updated October 1, 2026 1 min read

One request places an outbound call from the agent to one number, right away. To send many leads, use a dial list filled through the API instead.

  1. Create an API key with the calls:place scope

    How to create and manage API keys.

  2. Copy the agent's ID

    The ID is in the address of the agent page, after agents/.

  3. Send a POST request with the agent ID and the phone number

Example request
curl -X POST 'https://platform.direnium.com/api/v1/calls' \
  -H 'Authorization: Bearer <API-KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
    "agentId": "<AGENT-ID>",
    "to": "+9725XXXXXXXX",
    "variables": { "first_name": "Dana", "car_model": "Mazda 3" },
    "idempotencyKey": "lead-48213-call-1"
  }'
Request fields
FieldDescription
agentIdstringRequiredThe ID of the agent that makes the call.
tostringRequiredThe customer's phone number, preferably in international format.
variablesobjectOptionalValues for the variables in the script, by variable name.
idempotencyKeystringOptionalYour own ID for the request. A repeated request with the same ID returns the same call and does not dial again.
Response: 201
{
  "id": "<CALL-ID>",
  "status": "dialing",
  "to": "+9725XXXXXXXX",
  "createdAt": "<ISO-TIME>"
}

Which errors can I get?

  • 400: a field is missing, or the phone number is invalid or to an unsupported destination.
  • 401: the key is missing or wrong.
  • 403: the key lacks the scope, the agent is off, the minutes ran out, or the customer opted out.
  • 404: the agent was not found, or it has no outbound calls.
  • 409: this number was dialed a moment ago.
  • 422: outside the agent's calling hours. The response includes nextOpenAt, the next time a call is possible.
  • 429: too many requests in a minute.

How do I know what happened on the call?

Keep the id you got back. When the call ends, the voice.call_completed event is sent to your webhook, and you can also fetch the call, its transcript and its recording.

More in this topic

    ↑↓Navigate EnterOpen EscClose Searching English articles · עברית