Submit a contact
Submits a contact for processing through the qualification engine. Triggers routing, qualification, and delivery. This is the primary endpoint for external contact submissions.
Authorization
ApiKeyAuth API key generated from your Vayaflow dashboard Settings page
In: header
Request Body
application/json
Existing contact ID. When provided, the contact's existing data is used and the contact is re-submitted through the qualification engine. Contact fields become optional
The playbook to add this contact to. Optional: without one the contact is created in no playbook and no pipeline runs (the response is 201 with playbookId: null). An unknown playbook is refused with 400 PLAYBOOK_NOT_FOUND. Required when callbackUrl is set
1 <= lengthContact's first name. Required for new contacts, optional when contactId is provided
Contact's last name. Required for new contacts, optional when contactId is provided
Contact's email address. Required for new contacts, optional when contactId is provided
emailContact's phone number with at least 10 digits. Can include +, dashes, spaces, and parentheses (e.g. +1 (555) 123-4567). Required for new contacts, optional when contactId is provided
10 <= lengthContact'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 contact (test universe; no pixel firing). The do-not-contact and deduplication checks still run. Test-ness is never inferred from a name or email.
Contact's IANA timezone (e.g. America/New_York, America/Los_Angeles)
Internal notes about this contact
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.vayaflow.com/api/v1/contacts/submit" body := strings.NewReader(`{ "playbookId": "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": {
"contactId": "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"
}
}