Get a questionnaire
Returns a single questionnaire by ID, including its full list of questions with keys, text, instructions, and predefined options.
Authorization
ApiKeyAuth API key generated from your Leadsail dashboard Settings page
In: header
Path Parameters
The questionnaire ID (qst_xxx format)
Response Body
application/json
application/json
application/json
package mainimport ( "fmt" "net/http" "io/ioutil")func main() { url := "https://api.leadsail.app/api/v1/questionnaires/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": {
"questionnaireId": "qst_abc123",
"name": "string",
"description": "string",
"active": true,
"questions": [
{
"key": "filing_for",
"question": "Are you filing on behalf of yourself or someone else?",
"instructions": "string",
"options": [
"Self",
"Someone else"
]
}
],
"createdAt": "string",
"updatedAt": "string"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}List questionnaires
Returns all questionnaires for the authenticated tenant. Questionnaires define the questions asked to leads during voice calls or form intake.
Create a field library entry
Creates a new field in the field library. **Key validation:** - The `key` must be dot-separated segments, each starting with a letter and containing only letters, numbers, and underscores (e.g. `filing_for`, `address.street`). Empty, malformed, or specially-charactered keys are rejected with a 400. - Keys are auto-prefixed by category when not already prefixed: `custom` → `customFields.`, `question` → `questionnaire.`, `attribution` → `attribution.params.`. For example, creating key `filing_for` with category `question` stores it as `questionnaire.filing_for`. - If the (prefixed) key already exists for your tenant, the request is rejected with a 409 Conflict.