LeadSail
Voice Calls

Initiate an AI voice call

Triggers an outbound AI voice call to a lead. The call is placed asynchronously and the response returns immediately with an interaction ID for tracking. Pre-flight validation checks that the lead exists with a valid E.164 phone number, the campaign is active with a voice agent configured, the lead is not on the Do Not Call list, and auto-dialer rules are satisfied (operating hours, min gap, max attempts). Use webhooks to receive call completion events, or poll the interaction for status updates.

POST
/api/v1/voice/calls/initiate

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Request Body

application/json

leadId*string

The lead to call

direction?string

Call direction. Defaults to outbound.

Default"outbound"
Value in"inbound" | "outbound"
phone?string

Override the lead's phone number (E.164 format). If omitted, uses the lead's phone on file.

campaignId?string

Override the lead's campaign. If omitted, uses the lead's assigned campaign.

additionalInstructions?string

Extra instructions appended to the voice agent's prompt for this call.

isTest?boolean

If true, bypasses campaign active check and marks the interaction as a test.

Response Body

application/json

application/json

application/json

application/json

package mainimport (  "fmt"  "net/http"  "io/ioutil"  "strings")func main() {  url := "https://api.leadsail.app/api/v1/voice/calls/initiate"  body := strings.NewReader(`{    "leadId": "lead_abc123"  }`)  req, _ := http.NewRequest("POST", url, body)  req.Header.Add("Content-Type", "application/json")  res, _ := http.DefaultClient.Do(req)  defer res.Body.Close()  body, _ := ioutil.ReadAll(res.Body)  fmt.Println(res)  fmt.Println(string(body))}
{
  "success": true,
  "data": {
    "interactionId": "int_abc123",
    "leadId": "string",
    "campaignId": "string",
    "agentId": "string"
  }
}
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid input data",
    "details": [
      "string"
    ]
  }
}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Resource not found"
  }
}