---
title: "Create KB Source"
method: POST
path: "/knowledge-base/sources"
tags: ["Knowledge Base"]
---

# Create KB Source

`POST /knowledge-base/sources`

Creates a new knowledge base source with inline content. Automatically triggers indexing for vector search. For file uploads, use the upload endpoint instead.

## Request body

- CreateKBSourceRequest
  - `title` string, required — Title of the KB source
  - `content` string — Content of the source (required for manual entries)
  - `format` 'text/markdown' | 'text/html' | 'text/plain' — Content format (defaults to text/markdown). For PDF files, use the upload endpoint instead.

## Response `201`

KB source created successfully

- KBSourceResponse
  - `data` KBSource
    - `type` string — Resource type
    - `id` string — Unique identifier of the KB source
    - `attributes` KBSourceAttributes
      - `title` string — Title of the KB source
      - `source_type` 'manual' | 'upload' — Type of source: manual (inline content) or upload (S3 file)
      - `content` string — Content of the source (present on get, absent on list)
      - `format` string — Content format (e.g. text/markdown, application/pdf, text/html, text/plain)
      - `status` 'pending' | 'uploading' | 'indexing' | 'indexed' | 'failed' — Processing status of the source
      - `file_size` integer — File size in bytes
      - `chunk_count` integer — Number of indexed chunks
      - `created_at` string, date-time — Creation timestamp
      - `updated_at` string, date-time — Last update timestamp

## Other responses

- `400` — Invalid request parameters
- `401` — Valid API key required
- `default` — Unexpected error

---

[API](https://skmtc.net/attention/apis/attention-service-v2.md) · [All operations](https://skmtc.net/attention/apis/attention-service-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/attention/attention-service-v2/revisions/5de55d3804cf/schema)
