VayaFlow
Documents

List a contact's documents

Every document the contact owes or receives for a playbook, where each stands, and the state of the contact's link. Omit playbookId for documents sent outside any playbook.

GET
/api/v1/contacts/{contactId}/documents

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Path Parameters

contactId*string

Query Parameters

playbookId?string

Response Body

application/json

application/json

application/json

application/json

package mainimport (  "fmt"  "net/http"  "io/ioutil")func main() {  url := "https://api.vayaflow.com/api/v1/contacts/cont_abc123/documents"  req, _ := http.NewRequest("GET", url, nil)    res, _ := http.DefaultClient.Do(req)  defer res.Body.Close()  body, _ := ioutil.ReadAll(res.Body)  fmt.Println(res)  fmt.Println(string(body))}
{
  "success": true,
  "data": {
    "playbookId": "string",
    "items": [
      {
        "fileKey": "retainer",
        "name": "Retainer agreement",
        "kind": "esign",
        "required": true,
        "includeByDefault": true,
        "status": "not_sent",
        "documentId": "string",
        "variant": "string",
        "documentTemplateId": "string",
        "inEnvelopeIds": [
          "string"
        ]
      }
    ],
    "link": {
      "state": "active",
      "portalLinkId": "string",
      "expiresAt": "string",
      "portalUrl": "string"
    },
    "envelopes": [
      {
        "envelopeId": "env_abc123",
        "createdAt": "string",
        "source": "agent",
        "status": "open",
        "documents": [
          {
            "fileKey": "string",
            "name": "string"
          }
        ],
        "done": 0,
        "total": 0
      }
    ]
  }
}
{
  "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"
  }
}