Send a document
Sends one document template to a contact: an e-sign document (it has a signature field) or a form (no signature field). Each person on it gets their own link by email (and SMS when asked), in order. The finished copy saves on the contact under fileKey, and a document_completed event fires when everyone is done. Responds 409 when an open copy someone already started exists, unless replaceInProgress is true.
Authorization
ApiKeyAuth API key generated from your Vayaflow dashboard Settings page
In: header
Path Parameters
Request Body
application/json
The contact to send the document to.
Where the finished document saves on the contact (e.g. "retainer"). Defaults to "document".
Email the link to each person. Defaults to true.
Also text the link. Defaults to false.
Values for this send only, keyed by the field binding token. They win over the contact data.
Who takes each role on this send, when the template does not already say.
Replace an open copy that someone already started. Their entries are voided.
Response Body
application/json
application/json
application/json
application/json
package mainimport ( "fmt" "net/http" "io/ioutil" "strings")func main() { url := "https://api.vayaflow.com/api/v1/document-templates/stpl_abc123/send" body := strings.NewReader(`{ "contactId": "contact_abc123" }`) 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": {
"submissionId": "ssub_abc123",
"signingUrl": "string",
"contactId": "string",
"templateId": "string",
"templateName": "string"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid input data",
"details": [
"string"
]
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}Send an SMS message
Sends an SMS message to a contact. Only the contact ID and message are required — the recipient phone, sender phone, and SMS provider are automatically resolved from the contact and playbook configuration. The recipient defaults to the contact phone on file. The sender is resolved from the playbook assigned phone number, then the SMS agent phone, then the first SMS-capable number. The provider follows the playbook-level override, then the tenant default, then Vonage. If an interactionId is provided, the message is appended to an existing conversation. Otherwise, the system finds or creates a conversation automatically.
Send documents to a contact
Sends a playbook's documents (or one template) to a contact as one send with one link to the contact's documents page. With no documents list, every outstanding document whose conditions match the contact and that the playbook includes by default goes. Documents already done, or already sent and still open, are skipped and listed, never sent twice. The link is reused across sends for the same contact and playbook, and each send extends it. Responds 409 NOTHING_TO_SEND when every document is done, already out, or does not apply.