Answer one questionnaire question
curl --request POST \
--url https://api.trycomp.ai/v1/questionnaire/answer-single \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "Do you encrypt customer data at rest?",
"questionIndex": 0,
"totalQuestions": 12,
"organizationId": "org_abc123"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question: 'Do you encrypt customer data at rest?',
questionIndex: 0,
totalQuestions: 12,
organizationId: 'org_abc123'
})
};
fetch('https://api.trycomp.ai/v1/questionnaire/answer-single', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/questionnaire/answer-single"
payload = {
"question": "Do you encrypt customer data at rest?",
"questionIndex": 0,
"totalQuestions": 12,
"organizationId": "org_abc123"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"questionIndex": 123,
"question": "<string>",
"answer": "<string>",
"sources": [
{}
],
"error": "<string>"
}
}Questionnaire
Answer one questionnaire question | Comp AI API
Generate an answer for one security questionnaire item using the organization evidence library and return source references for review.
POST
/
v1
/
questionnaire
/
answer-single
Answer one questionnaire question
curl --request POST \
--url https://api.trycomp.ai/v1/questionnaire/answer-single \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"question": "Do you encrypt customer data at rest?",
"questionIndex": 0,
"totalQuestions": 12,
"organizationId": "org_abc123"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question: 'Do you encrypt customer data at rest?',
questionIndex: 0,
totalQuestions: 12,
organizationId: 'org_abc123'
})
};
fetch('https://api.trycomp.ai/v1/questionnaire/answer-single', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/questionnaire/answer-single"
payload = {
"question": "Do you encrypt customer data at rest?",
"questionIndex": 0,
"totalQuestions": 12,
"organizationId": "org_abc123"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"questionIndex": 123,
"question": "<string>",
"answer": "<string>",
"sources": [
{}
],
"error": "<string>"
}
}Authorizations
API key for authentication
Body
application/json
Security questionnaire question to answer.
Example:
"Do you encrypt customer data at rest?"
Zero-based index of this question in the questionnaire or page batch.
Required range:
x >= 0Example:
0
Total number of questions in the current questionnaire or page batch.
Required range:
x >= 1Example:
12
Organization ID for validation. The API uses the authenticated active organization and overwrites this value server-side.
Example:
"org_abc123"
Optional questionnaire record to save the generated answer into. Omit for webpage-only answer generation.
Example:
"qst_abc123"
Was this page helpful?

