curl --request POST \
--url https://api.trycomp.ai/v1/questionnaire/{id}/auto-answer \
--header 'X-API-Key: <api-key>'const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.trycomp.ai/v1/questionnaire/{id}/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/{id}/auto-answer"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"questionnaireId": "qst_6a179d26c4ad2c1c816ee16d",
"runId": "run_cmpotsz153eac0ultc1ya87f5",
"publicAccessToken": "pat_...",
"status": "generating",
"totalQuestions": 23,
"answeredQuestions": 0,
"message": "Generating answers for 23 questions. Poll GET /v1/questionnaire/qst_... until answeredQuestions reaches totalQuestions."
}Generate answers for a questionnaire | Comp AI API
Starts background answer generation for an already-parsed questionnaire and returns a run handle immediately. Poll GET /v1/questionnaire/:id until.
curl --request POST \
--url https://api.trycomp.ai/v1/questionnaire/{id}/auto-answer \
--header 'X-API-Key: <api-key>'const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.trycomp.ai/v1/questionnaire/{id}/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/{id}/auto-answer"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"questionnaireId": "qst_6a179d26c4ad2c1c816ee16d",
"runId": "run_cmpotsz153eac0ultc1ya87f5",
"publicAccessToken": "pat_...",
"status": "generating",
"totalQuestions": 23,
"answeredQuestions": 0,
"message": "Generating answers for 23 questions. Poll GET /v1/questionnaire/qst_... until answeredQuestions reaches totalQuestions."
}Authorizations
API key for authentication
Path Parameters
Response
The questionnaire whose answers are being generated.
"qst_6a179d26c4ad2c1c816ee16d"
Background run identifier for the generation job (Trigger.dev run id).
"run_cmpotsz153eac0ultc1ya87f5"
Token for tracking the run via Trigger.dev realtime. Optional — MCP/agent clients should poll GET /v1/questionnaire/:id instead.
"pat_..."
Always 'generating' on a successful trigger. Poll GET /v1/questionnaire/:id; answers are ready once answeredQuestions equals totalQuestions.
"generating"
Total number of questions in the questionnaire.
23
Questions already answered at the moment generation was triggered (answers without a value are (re)generated).
0
Human-readable summary of what to do next.
"Generating answers for 23 questions. Poll GET /v1/questionnaire/qst_... until answeredQuestions reaches totalQuestions."
Was this page helpful?

