Logo
EntryForm Filler

Form Filling

View Docs

API Reference

POST
/api/agent/form/fill

Authorization

ApiKeyAuth
access-key<token>

Your unique access-key generated from the platform UI

In: header

Request Body

application/json

source_doc_process_ids*array<string>

Array of source document IDs containing data to fill the form (obtained from Upload or List Documents APIs). Only documents with status 'processed' can be used.

model_data*
unfilled_form_data*

Form structure from Form Generation API response

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.k-v.ai/api/agent/form/fill" \  -H "Content-Type: application/json" \  -d '{    "source_doc_process_ids": [      "your_doc_id"    ],    "model_data": {      "model_name": "gpt-5.1",      "api_key": ""    },    "unfilled_form_data": [      {        "label": "Given Name",        "type": "text",        "example": null,        "options": null,        "user_value": {          "source": null,          "possible_value": null        }      },      {        "label": "Driving License",        "type": "select",        "example": null,        "options": [          "Yes",          "No"        ],        "user_value": {          "source": null,          "possible_value": null        }      }    ]  }'
{
  "value": {
    "data": [
      {
        "label": "Given Name",
        "type": "text",
        "example": null,
        "options": null,
        "user_value": {
          "source": "john_smith_story.pdf",
          "possible_value": "John",
          "doc_hash": [
            "bca03f7db29b5f22c293f6cff2bf378a"
          ]
        },
        "possible_values": [
          {
            "source": "john_smith_story.pdf",
            "possible_value": "John",
            "doc_hash": [
              "bca03f7db29b5f22c293f6cff2bf378a"
            ]
          }
        ]
      },
      {
        "label": "House nr",
        "type": "text",
        "example": null,
        "options": null,
        "user_value": {
          "source": "john_smith_story.pdf",
          "possible_value": "45B",
          "doc_hash": [
            "bca03f7db29b5f22c293f6cff2bf378a"
          ]
        },
        "possible_values": [
          {
            "source": "john_smith_story.pdf",
            "possible_value": "45B",
            "doc_hash": [
              "bca03f7db29b5f22c293f6cff2bf378a"
            ]
          },
          {
            "source": "john_smith_story.pdf",
            "possible_value": "123",
            "doc_hash": [
              "bca03f7db29b5f22c293f6cff2bf378a"
            ]
          }
        ]
      }
    ],
    "message": "Form filled 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."
}