---
title: "Generate Schema"
method: POST
path: "/api/templates/generate-schema"
tags: ["Extraction Templates"]
---

# Generate Schema

`POST /api/templates/generate-schema`

## Request

- Base URL: `https://api.qomplement.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.qomplement.com/api/templates/generate-schema`
- Auth: HTTP bearer

Conversational schema generator using AI agent.
Streams events via SSE: token, schema_update, done.

## Request body

- SchemaGeneratorRequest: Request model for conversational schema generation
  - `messages` object[]
  - `document_text` string
  - `document_data` object
  - `existing_schema` object, nullable
  - `template_id` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/qomplement/apis/qomplement-api.md) - [All operations](https://skmtc.dev/qomplement/apis/qomplement-api/llms.txt) - [OpenAPI document](https://skmtc.dev/qomplement/apis/qomplement-api/revisions/6fe617c112ef?raw)
