Leads
Create a lead (direct)
Directly creates a lead without engine processing. Used for imports, migrations, and the Add Lead UI. Does not trigger qualification or delivery.
Authorization
ApiKeyAuth X-API-Key<token>
API key generated from your Vayaflow dashboard Settings page
In: header
Request Body
application/json
campaignId*string
Length
1 <= lengthfirstName*string
Length
1 <= lengthlastName*string
Length
1 <= lengthemail*string
Format
emailphone*string
Match
^[\d\s\-\(\)\.+]+$Length
10 <= lengthcountry?string
Match
^[A-Z]{2}$Length
2 <= length <= 2address?
timezone?string
timezoneSource?string
flags?
notes?array<>
questionnaire?|array<>
Default
{}attribution?
compliance?
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" body := strings.NewReader(`{ "campaignId": "string", "firstName": "string", "lastName": "string", "email": "user@example.com", "phone": "stringstri" }`) 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"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input data",
"details": [
"string"
]
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
}
}