Get a specific file
Returns a single file by its leadId and fileKey.
Authorization
ApiKeyAuth API key generated from your Leadsail dashboard Settings page
In: header
Path Parameters
The lead ID
The file key (e.g. "retainer_signed")
Response Body
application/json
application/json
application/json
package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://api.leadsail.app/api/v1/files/string/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": {
"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"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}Get all files for a lead
Returns all file references associated with a lead.
Create a questionnaire
Creates a new questionnaire. The questionnaireId (qst_xxx) is auto-generated. **Question key validation:** - Each question `key` must be a valid field key: dot-separated segments, each starting with a letter and containing only letters, numbers, and underscores (e.g. `questionnaire.filing_for`, `dateOfBirth`). - Each key must already exist in the field library for your tenant. Unknown keys are rejected with a 400 `UNKNOWN_FIELD_KEYS` error listing the offending keys. Create missing fields first via `POST /api/v1/field-library`, or look up existing keys via `GET /api/v1/field-library`.