Send an SMS message
Sends an SMS message to a lead. Only the lead ID and message are required — the recipient phone, sender phone, and SMS provider are automatically resolved from the lead and campaign configuration. The recipient defaults to the lead phone on file. The sender is resolved from the campaign assigned phone number, then the SMS agent phone, then the first SMS-capable number. The provider follows the campaign-level override, then the tenant default, then Vonage. If an interactionId is provided, the message is appended to an existing conversation. Otherwise, the system finds or creates a conversation automatically.
Authorization
ApiKeyAuth API key generated from your Vayaflow dashboard Settings page
In: header
Request Body
application/json
The lead to send the SMS to
The SMS message body (1–1600 characters).
1 <= length <= 1600Override the recipient phone number (E.164 format). If omitted, uses the lead's phone on file.
Override the sender phone number. If omitted, auto-resolves from the campaign's assigned phone number.
Override the lead's campaign for sender resolution. If omitted, uses the lead's assigned campaign.
Append to an existing SMS conversation. If omitted, a new conversation is created or an existing one is found automatically.
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/sms/send" body := strings.NewReader(`{ "leadId": "lead_abc123", "message": "Hi John, just following up on your inquiry." }`) 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": {
"messageId": "msg_abc123",
"status": "sent",
"interactionId": "int_abc123"
}
}{
"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"
}
}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.
Send a document for signing
Sends a document template (e.g. retainer agreement) to a lead for electronic signing via DocuSeal. Provide a documentTemplateId to send a specific template, or a campaignId to let the system select one based on configured conditions and the fileKey. The signing link is sent via email by default. Set sendSms to true to also send via SMS, or sendEmail to false to skip email and use the returned signingUrl directly. A File record is created on the lead with the given fileKey, and the status progresses automatically through pending, viewed, in_progress, and signed via webhooks.