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
| Parameter | Type | Required | Description |
|---|---|---|---|
from | string | Yes | JustCall phone number to dial from (E.164 format) |
to | string | Yes | Customer phone number to call (E.164 format) |
agent_id | integer | No | ID of the agent who will handle the call. Defaults to the number owner. |
callback_url | string | No | URL to receive real-time call status updates via POST |
caller_id | string | No | Override 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:
| Status | Description |
|---|---|
ringing | The agent's device is ringing |
in-progress | Agent and customer are connected |
completed | Call ended normally |
no-answer | Customer did not pick up |
busy | Customer line was busy |
failed | Call could not be connected |
Each callback includes call_id, status, duration (in seconds), and timestamp.
How the Call Flow Works
- Your application sends the POST request.
- JustCall rings the assigned agent (phone, desktop app, or mobile app).
- When the agent answers, JustCall dials the customer number.
- Both parties are connected. The call is logged automatically.
- 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
| Code | Meaning | Fix |
|---|---|---|
| 400 | Missing required field (from or to) | Include both numbers in E.164 format |
| 401 | Invalid credentials | Check your API key and secret |
| 404 | from number not found in your account | Use a number assigned to your JustCall account |
| 429 | Rate limit exceeded | Wait and retry with exponential backoff |
Related Articles
Was this helpful?