POST /api/v1/make-call
Outbound call initiation with DNC compliance, wallet check, and number pool
Make Call
Initiates outbound phone calls via Telnyx — handles number resolution, DNC compliance, wallet balance check, number validation, and dynamic variable filling.
Volume: ~661K runs/week | Auth: None (internal service call)
Request
POST /api/v1/make-call
Content-Type: application/jsonBody Parameters
| Field | Type | Required | Description |
|---|---|---|---|
location_id | string | ✅ | GHL location ID |
assistant_id | string | ✅ | Internal assistant ID |
contact_id | string | GHL contact ID (to resolve phone) | |
phone_number | string | Direct phone number to call | |
number_pool | string | Number pool ID for caller ID rotation | |
workflow_id | string | Workflow ID | |
custom_one | string | Custom variable 1 | |
custom_two | string | Custom variable 2 | |
custom_three | string | Custom variable 3 | |
custom_four | string | Custom variable 4 | |
custom_five | string | Custom variable 5 |
Responses
Success
{
"status": "success",
"call": {
"call_id": "telnyx_call_uuid",
"call_control_id": "control_uuid"
},
"from": "+15551234567",
"to": "+15559876543"
}No Access Token
{ "error": "No access token", "status": "failed" }Assistant Not Found
{ "error": "Assistant not found", "status": "failed" }No Phone Number
{ "error": "No phone number available", "status": "failed" }DNC Blocked (Internal)
{ "error": "Number on internal DNC list", "status": "blocked" }DNC Blocked (National)
{ "error": "Number on national DNC list", "status": "blocked" }Wallet Depleted
{ "error": "Wallet depleted", "status": "blocked" }Invalid Number
{ "error": "Invalid phone number", "status": "blocked" }Test with cURL
curl -X POST http://localhost:3000/api/v1/make-call \
-H "Content-Type: application/json" \
-d '{
"location_id": "loc_123",
"assistant_id": "asst_456",
"phone_number": "+15559876543"
}'With contact resolution
curl -X POST http://localhost:3000/api/v1/make-call \
-H "Content-Type: application/json" \
-d '{
"location_id": "loc_123",
"assistant_id": "asst_456",
"contact_id": "contact_789",
"number_pool": "pool_001",
"custom_one": "Campaign A"
}'Pipeline Flow
- Rate limit check (non-blocking)
- Fetch SubAccount access token (Prisma)
- Parallel: validate assistant + fetch GHL contact
- Resolve phone number (direct or from contact)
- Number pool resolution (random from pool, or fallback to assistant's number)
- DNC compliance: internal DB (
CrmContact.DO_NOT_CONTACT) + freednclist.com - Wallet balance check (aggregate transactions, threshold: -$100)
- Number validation (api.assistable.ai)
- Voice variable filling
- SIP trunk lookup
- Initiate call via Telnyx
- Record call in DB