LeadSail
Files

Get all files for a lead

Returns all file references associated with a lead.

GET
/api/v1/files/{leadId}

Authorization

ApiKeyAuth
X-API-Key<token>

API key generated from your Vayaflow dashboard Settings page

In: header

Path Parameters

leadId*string

The lead ID

Response Body

application/json

application/json

package mainimport (  "fmt"  "net/http"  "io/ioutil")func main() {  url := "https://api.leadsail.app/api/v1/files/string"  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": {
    "leadId": "string",
    "files": [
      {
        "fileId": "file_abc123",
        "leadId": "lead_xyz789",
        "fileKey": "retainer_signed",
        "fileName": "retainer_signed.pdf",
        "fileType": "pdf",
        "documentUrl": "https://storage.example.com/files/retainer_signed.pdf",
        "status": "signed",
        "provider": "docuseal",
        "createdAt": "2024-06-15T10:30:00Z",
        "updatedAt": "2024-06-15T14:22:00Z",
        "signedAt": "2024-06-15T14:22:00Z"
      }
    ],
    "count": 0
  }
}
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}