Click-to-Call via API

Connect my tools3 min readUpdated 2026-03-12

Click-to-Call via API

The click-to-call endpoint lets you initiate an outbound call directly from your own application. JustCall rings your agent first, then connects them to the customer — so the experience feels seamless to both parties.

Endpoint

POST https://api.justcall.io/v2/calls/make

Request Parameters

ParameterTypeRequiredDescription
fromstringYesJustCall phone number to dial from (E.164 format)
tostringYesCustomer phone number to call (E.164 format)
agent_idintegerNoID of the agent who will handle the call. Defaults to the number owner.
callback_urlstringNoURL to receive real-time call status updates via POST
caller_idstringNoOverride the displayed caller ID (must be a verified number)

Code Example

curl -X POST "https://api.justcall.io/v2/calls/make" \
  -H "Authorization: {api_key}:{api_secret}" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "+14155551234",
    "to": "+14155559876",
    "agent_id": 42,
    "callback_url": "https://yourapp.com/webhooks/call-status"
  }'

Successful Response

{
  "status": "success",
  "message": "Call initiated",
  "data": {
    "call_id": "call_8f3a2b1c",
    "from": "+14155551234",
    "to": "+14155559876",
    "agent_id": 42,
    "direction": "outbound",
    "status": "ringing"
  }
}

Callback URL Payloads

If you provide a callback_url, JustCall sends a POST request at each stage of the call:

StatusDescription
ringingThe agent's device is ringing
in-progressAgent and customer are connected
completedCall ended normally
no-answerCustomer did not pick up
busyCustomer line was busy
failedCall could not be connected

Each callback includes call_id, status, duration (in seconds), and timestamp.

How the Call Flow Works

  1. Your application sends the POST request.
  2. JustCall rings the assigned agent (phone, desktop app, or mobile app).
  3. When the agent answers, JustCall dials the customer number.
  4. Both parties are connected. The call is logged automatically.
  5. Status updates are sent to your callback URL in real time.

Common Use Cases

  • CRM click-to-call buttons — Let reps dial prospects without leaving Salesforce, HubSpot, or your custom CRM.
  • Automated outreach triggers — Fire a call when a lead fills out a high-intent form.
  • Support ticket callbacks — Trigger a return call when a ticket reaches a certain priority.

Error Handling

CodeMeaningFix
400Missing required field (from or to)Include both numbers in E.164 format
401Invalid credentialsCheck your API key and secret
404from number not found in your accountUse a number assigned to your JustCall account
429Rate limit exceededWait and retry with exponential backoff

Was this helpful?