---
title: "Generate KB schema"
method: POST
path: "/api/v0/knowledge-bases/{kb_id}/schemas"
tags: ["Knowledge Bases"]
---

# Generate KB schema

`POST /api/v0/knowledge-bases/{kb_id}/schemas`

Create a schema row and enqueue LLM-powered schema generation.

## Path parameters

- `kb_id` string, uuid, required

## Request body

- KBSchemaCreateRequest — Request body for creating (generating) a KB schema.
  - `user_hint` string — Optional hint to guide schema generation.
  - `sample_count` integer — Number of documents to sample for schema generation.

## Response `200`

Successful Response

- KBSchemaPostResponse — Response for creating a KB schema (with async generation).
  - `id` string, uuid, required — The ID of the created schema.
  - `job_status_id` string, uuid, required — The job status ID for polling schema generation progress.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/outerport/apis/outerport-api.md) · [All operations](https://skmtc.dev/outerport/apis/outerport-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/outerport/outerport-api/revisions/f565b46daaea/schema)
