Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.questra.ai/llms.txt

Use this file to discover all available pages before exploring further.

Questra’s API lets you build a fully whitelabeled AI survey-programming workflow inside your own product. This guide walks through the complete lifecycle: uploading a questionnaire, answering clarification questions, starting AI programming, and accessing the finished platform-native survey.

Authentication

Every request requires your API key as a Bearer token and your organization ID in the X-Org-Id header. All endpoints live at api.questra.ai. You can create API keys and find your organization ID from the Questra dashboard. See the Authentication guide for details.

Survey lifecycle

1

Create a survey from a questionnaire

Upload your questionnaire file with POST /surveys and save the id from the response.Reference: POST /surveys
2

Answer clarifying questions (optional)

After upload, your app can run a stateless Q&A pass against the uploaded file. Call POST /files/{fileId}/qa and read the server-sent events as questions are detected. Store the questions and answers client-side until you are ready to start programming.
event: discrepancy
data: {"kind":"reference-missing","severity":"blocker","summary":"Q3 routes to an undefined end page."}

event: done
data: {"count":1}
Send answered items back as priorQa on later Q&A calls so Questra does not re-ask resolved questions. If the stream finishes with count: 0, Q&A is done.Reference: Survey Q&A
3

Set the destination

Tell Questra which platform and integration to target with PUT /surveys/{id}/destination. This can be called before or after start-programming.Reference: PUT /surveys/{id}/destination
4

Start programming

Kick off the AI programming pipeline with POST /surveys/{id}/start-programming. This is idempotent and safe to retry. Include the full Q&A snapshot when you collected clarifications:
{
  "qa": [
    {
      "id": "q1",
      "kind": "reference-missing",
      "severity": "blocker",
      "summary": "Q3 routes to an undefined end page.",
      "userClarification": "Route respondents to the termination screen."
    }
  ]
}
Reference: POST /surveys/{id}/start-programming
5

Wait for completion

Poll GET /surveys/{id} until status reaches reviewing, or use webhooks to avoid polling.Reference: GET /surveys/{id}
6

Access the platform survey

Once status is reviewing, retrieve the connected platform survey via GET /integrations/{id}/surveys and create participant sources (distribution links) with POST /integrations/{id}/surveys/{surveyId}/sources.References: GET /integrations/{id}/surveys · POST /integrations/{id}/surveys/{surveyId}/sources

Next steps

Webhooks

Receive HTTP notifications when events happen in your organization.

Authentication

Set up API keys and authenticate requests.

Survey Q&A

Implement optional clarification Q&A before programming starts.

History

Track every IR change with changesets and revert to any previous state.