Answer one questionnaire question
POST
/v1/questionnaire/answer-single
const url = 'https://api.varman.io/v1/questionnaire/answer-single';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"question":"Do you encrypt customer data at rest?","questionIndex":0,"totalQuestions":12,"organizationId":"org_abc123","questionnaireId":"qst_abc123"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.varman.io/v1/questionnaire/answer-single \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "question": "Do you encrypt customer data at rest?", "questionIndex": 0, "totalQuestions": 12, "organizationId": "org_abc123", "questionnaireId": "qst_abc123" }'Generate an answer for one security questionnaire item using the organization evidence library and return source references for review.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
question
required
Security questionnaire question to answer.
string
Example
Do you encrypt customer data at rest?questionIndex
required
Zero-based index of this question in the questionnaire or page batch.
number
Example
0totalQuestions
required
Total number of questions in the current questionnaire or page batch.
number
Example
12organizationId
required
Organization ID for validation. The API uses the authenticated active organization and overwrites this value server-side.
string
Example
org_abc123questionnaireId
Optional questionnaire record to save the generated answer into. Omit for webpage-only answer generation.
string
Example
qst_abc123Responses
Section titled “Responses”Generated single answer result
Media typeapplication/json
object
success
boolean
data
object
questionIndex
number
question
string
answer
string
sources
Array<object>
object
error
string
Example generated
{ "success": true, "data": { "questionIndex": 1, "question": "example", "answer": "example", "sources": [ {} ], "error": "example" }}