VayaFlow
Contacts

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.

POST
/api/v1/contacts/submit

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Request Body

application/json

contactId?string

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

playbookId?string

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

Length1 <= length
firstName?string

Contact's first name. Required for new contacts, optional when contactId is provided

lastName?string

Contact's last name. Required for new contacts, optional when contactId is provided

email?string

Contact's email address. Required for new contacts, optional when contactId is provided

Formatemail
phone?string

Contact'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

Length10 <= length
address?

Contact's mailing address

dateOfBirth?string

Date of birth in YYYY-MM-DD format (e.g. 1990-05-15)

country?string

Two-letter ISO country code, uppercase (e.g. US, CA, MX)

files?array<>

Array of file attachments (documents, images, etc.)

questionnaire?|array<>

Questionnaire answers. Accepts object format (keys mapped to questions via field library) or array format with explicit question labels. Defaults to {}

Default{}
attribution?

Marketing attribution and tracking data

compliance?

TCPA consent and compliance verification data

isTest?boolean

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.

timezone?string

Contact's IANA timezone (e.g. America/New_York, America/Los_Angeles)

notes?string

Internal notes about this contact

customFields?

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"
  }
}