Logo
EntryQuestionnaire Filler

Questionnaire Generation

View Docs

API Reference

POST
/api/agent/questionnaire/generate

Authorization

ApiKeyAuth
access-key<token>

Your unique access-key generated from the platform UI

In: header

Request Body

application/json

doc_process_id*string

Document ID to extract questionnaire from (obtained from Upload or List Documents APIs)

model_data*

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.k-v.ai/api/agent/questionnaire/generate" \  -H "Content-Type: application/json" \  -d '{    "doc_process_id": "your_doc_id",    "model_data": {      "model_name": "gpt-5.1",      "api_key": ""    }  }'
{
  "value": {
    "data": {
      "document_id": "Settlement Agreement (1).pdf",
      "questionnaire": [
        {
          "question": "What is the name of the agreement entered into between ABC Software Corporation and Widget Corporation?",
          "type": "factual",
          "options": null,
          "example": "Settlement Agreement and Release",
          "user_value": {
            "source": null,
            "possible_value": null
          }
        },
        {
          "question": "Does the Plaintiff's release in this Agreement cover past, present, or future claims related to the faxed advertisement?",
          "type": "mcq",
          "options": [
            "Only past claims",
            "Only present claims",
            "Only future claims",
            "Past, present, and future claims"
          ],
          "example": "Past, present, and future claims",
          "user_value": {
            "source": null,
            "possible_value": null
          }
        }
      ]
    },
    "message": "Questionnaire created successfully"
  }
}
{
  "value": {
    "data": {},
    "message": "Invalid docs selected"
  }
}
{
  "value": {
    "data": {},
    "message": "Invalid or missing access key"
  }
}
{
  "detail": [
    {
      "type": "literal_error",
      "loc": [
        "string"
      ],
      "msg": "string",
      "input": "string",
      "ctx": {
        "expected": "string"
      }
    }
  ]
}

{
  "data": {},
  "message": "litellm.AuthenticationError: AuthenticationError: OpenAIException - Incorrect API key provided: tyrdfuih**uhf7. You can find your API key at https://platform.openai.com/account/api-keys."
}