Submit a lead
Submits a lead for processing through the qualification engine. Triggers routing, qualification, and delivery. This is the primary endpoint for external lead submissions.
Authorization
ApiKeyAuth API key generated from your Vayaflow dashboard Settings page
In: header
Request Body
application/json
Existing lead ID. When provided, the lead's existing data is used and the lead is re-submitted through the qualification engine. Contact fields become optional
The campaign code to submit this lead to. This is the short 3-5 character code found on the campaign (e.g. HXZ)
1 <= lengthLead's first name. Required for new leads, optional when leadId is provided
Lead's last name. Required for new leads, optional when leadId is provided
Lead's email address. Required for new leads, optional when leadId is provided
emailLead's phone number with at least 10 digits. Can include +, dashes, spaces, and parentheses (e.g. +1 (555) 123-4567). Required for new leads, optional when leadId is provided
10 <= lengthLead's mailing address
Date of birth in YYYY-MM-DD format (e.g. 1990-05-15)
Two-letter ISO country code, uppercase (e.g. US, CA, MX)
Array of file attachments (documents, images, etc.)
Questionnaire answers. Accepts object format (keys mapped to questions via field library) or array format with explicit question labels. Defaults to {}
{}Marketing attribution and tracking data
TCPA consent and compliance verification data
Set to true to mark this as a test lead. Test leads skip deduplication and pixel firing
Lead's IANA timezone (e.g. America/New_York, America/Los_Angeles)
Internal notes about this lead
Arbitrary custom fields as key-value pairs
Response Body
application/json
application/json
application/json
package mainimport ( "fmt" "net/http" "io/ioutil" "strings")func main() { url := "https://api.leadsail.app/api/v1/leads/submit" body := strings.NewReader(`{ "campaignId": "HXZ", "firstName": "Jane", "lastName": "Smith", "email": "jane.smith@example.com", "phone": "+1 (555) 123-4567", "address": { "street": "123 Main St", "city": "Phoenix", "state": "AZ", "zip": "85001" }, "dateOfBirth": "1990-05-15", "questionnaire": { "looking_for": "home_insurance", "homeowner": true }, "attribution": { "params": { "utm_source": "facebook", "utm_medium": "paid_social", "utm_campaign": "spring_2024" }, "fbclid": "fbclid_xyz789", "captureUrl": "https://example.com/landing" }, "isTest": false }`) 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": {
"leadId": "string",
"submissionId": "string",
"status": "string"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input data",
"details": [
"string"
]
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
}
}