LeadSail
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.

POST
/api/v1/leads

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Request Body

application/json

campaignId*string
Length1 <= length
firstName*string
Length1 <= length
lastName*string
Length1 <= length
email*string
Formatemail
phone*string
Match^[\d\s\-\(\)\.+]+$
Length10 <= length
country?string
Match^[A-Z]{2}$
Length2 <= length <= 2
address?
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"
  }
}