---
title: "Create Knowledge Source"
method: POST
path: "/api/v1/knowledge"
tags: ["knowledge"]
---

# Create Knowledge Source

`POST /api/v1/knowledge`

## Request

- Base URL: `https://api.gnosari.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gnosari.com/api/v1/knowledge`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-AUTH-TOKEN`

Create new knowledge source.

If auto_load=True (default), the knowledge source will be automatically
loaded asynchronously via the neoqueue outbox. The loading status can be
tracked by polling GET /knowledge/{id}.

## Query parameters

- `auto_load` boolean: Automatically load knowledge source after creation

## Request body

- KnowledgeSourceCreate: Create-request schema for a knowledge source. ``name`` and ``data_type`` are optional at the REQUEST level so a caller can submit only a URL and let the boundary (API endpoint / MCP tool) auto-resolve the whole-site ingestion strategy via ``resolve_website_source``: - ``data_type`` of ``None`` or ``"auto"`` triggers sitemap-vs-discovery resolution before ``create_source`` opens its transaction. - a blank ``name`` is derived from the URL hostname at the boundary. The PERSISTED value is always a concrete resolved string — the boundary fills both fields before calling ``create_source``. The DB column and persisted model are unchanged.
  - `name` string, nullable
  - `data_type` string, nullable: Ingestion type; omit or pass 'auto' for whole-site auto-resolve
  - `paths` string[]
  - `status` string
  - `description` string, nullable
  - `identifier` string, nullable
  - `config` object, nullable

## Response `201`

Successful Response

- KnowledgeSource: Response schema for knowledge source.
  - `name` string, required
  - `data_type` string, required
  - `paths` string[]
  - `status` string
  - `loading_status` 'unloaded' | 'loading' | 'loaded' | 'partial' | 'failed': Pydantic-compatible enum for serialization.
  - `description` string, nullable
  - `identifier` string, nullable
  - `config` object, nullable
  - `loaded_at` string, date-time, nullable
  - `loading_started_at` string, date-time, nullable
  - `loading_error` string, nullable
  - `loading_urls_total` integer, nullable
  - `loading_urls_done` integer, nullable
  - `document_count` integer
  - `id` integer, required
  - `account_id` integer, nullable
  - `agents` AgentMinimal[]
    - `id` integer, required
    - `name` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, nullable

## Other responses

- `422`: Validation Error

---

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