Stream generated questionnaire answers
curl --request POST \
--url https://api.trycomp.ai/v1/questionnaire/auto-answer \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"organizationId": "org_abc123",
"questionsAndAnswers": [
{
"question": "Do you encrypt customer data at rest?",
"answer": "<string>",
"_originalIndex": 0
}
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
organizationId: 'org_abc123',
questionsAndAnswers: [
{
question: 'Do you encrypt customer data at rest?',
answer: '<string>',
_originalIndex: 0
}
]
})
};
fetch('https://api.trycomp.ai/v1/questionnaire/auto-answer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/questionnaire/auto-answer"
payload = {
"organizationId": "org_abc123",
"questionsAndAnswers": [
{
"question": "Do you encrypt customer data at rest?",
"answer": "<string>",
"_originalIndex": 0
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Questionnaire
Stream generated questionnaire answers | Comp AI API
Stream generated questionnaire answers over server-sent events so clients can show progress while answers are produced.
POST
/
v1
/
questionnaire
/
auto-answer
Stream generated questionnaire answers
curl --request POST \
--url https://api.trycomp.ai/v1/questionnaire/auto-answer \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"organizationId": "org_abc123",
"questionsAndAnswers": [
{
"question": "Do you encrypt customer data at rest?",
"answer": "<string>",
"_originalIndex": 0
}
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
organizationId: 'org_abc123',
questionsAndAnswers: [
{
question: 'Do you encrypt customer data at rest?',
answer: '<string>',
_originalIndex: 0
}
]
})
};
fetch('https://api.trycomp.ai/v1/questionnaire/auto-answer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.trycomp.ai/v1/questionnaire/auto-answer"
payload = {
"organizationId": "org_abc123",
"questionsAndAnswers": [
{
"question": "Do you encrypt customer data at rest?",
"answer": "<string>",
"_originalIndex": 0
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)Authorizations
API key for authentication
Body
application/json
Organization ID. The API overwrites this with the authenticated active organization.
Example:
"org_abc123"
Questions to auto-answer, together with any answers already filled in.
Show child attributes
Show child attributes
Questionnaire to save generated answers into. Omit to stream answers without persisting them.
Example:
"qst_abc123"
Response
201 - undefined
Was this page helpful?

