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

# Create Knowledge Source

`POST /v1/agent/knowledge-sources`

## Request

- Base URL: `https://api.fish.audio`
- URL: `https://api.fish.audio/v1/agent/knowledge-sources`
- Auth: HTTP bearer

Upload a plain-text or Markdown file (UTF-8, up to 1 MB) as a knowledge
source. Send `multipart/form-data` with the file in `source`; `name`
defaults to the file name. Attach it to agents via the agent config's
`knowledge_base.knowledge_source_ids`.

## Request body `multipart/form-data`

- object
  - `source` string, binary, required
  - `name` string, nullable
  - `description` string

## Response `201`

Document created, URL follows

- object
  - `knowledge_source_id` string, required
  - `workspace_id` string, required
  - `name` string, required
  - `description` string
  - `file_name` string, required
  - `size_bytes` integer, required
  - `chunk_count` integer, required
  - `revision_number` integer, required: Increments every time the content is replaced. Drafts always use the newest revision; published versions pin the revision current at publish time.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `content` string, required: The full current text content.

## Other responses

- `400`: Bad request syntax or unsupported method
- `401`: No permission -- see authorization schemes
- `403`: Request forbidden -- authorization will not help
- `422`
- `503`: The server cannot process the request due to a high load

## Changes

- **2026-11-03** `42ac421f7a12`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/fish/apis/fishaudio-openapi/changes/v1/agent/knowledge-sources/post.md)

---

[API](https://skmtc.dev/fish/apis/fishaudio-openapi.md) - [All operations](https://skmtc.dev/fish/apis/fishaudio-openapi/llms.txt) - [OpenAPI document](https://skmtc.dev/fish/apis/fishaudio-openapi/revisions/42ac421f7a12?raw)
