Skip to main content
POST
Create a knowledge base

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Input for creating a knowledge base. See sourceType for which fields are required.

name
string
required

Customer-facing name. Unique within the project. Required.

Required string length: 1 - 120
sourceType
enum<string>
required

Source types accepted via the public create endpoint. URL ingestion is currently only available in the platform UI.

Available options:
TEXT,
FILE,
JSON
description
string | null

Optional short blurb shown in pickers.

Maximum string length: 500
content
string | null

For TEXT: raw markdown/text. For JSON: a JSON string (validated server-side and re-formatted with stable whitespace). Required for TEXT and JSON; omit for FILE.

filename
string | null

For FILE: customer-supplied filename (informational only — used for download links).

Required string length: 1 - 255
mimeType
enum<string> | null

For FILE: mime type of the uploaded file. Only application/pdf, text/plain, and text/markdown are accepted.

Available options:
application/pdf,
text/plain,
text/markdown
contentBase64
string | null

For FILE: base64-encoded file bytes. Required for FILE. Max 10 MB after decoding. PDFs are text-extracted server-side; image-only PDFs are rejected.

Response

The created knowledge base.

data
KnowledgeBase · object
required

A customer-uploaded reference document attached to custom metrics as ground truth at evaluation time.