---
title: "Add a knowledge base source"
method: POST
path: "/knowledge_base/{knowledge_base_id}/sources"
tags: [""]
---

# Add a knowledge base source

`POST /knowledge_base/{knowledge_base_id}/sources`

## Path parameters

- `knowledge_base_id` string, required — Knowledge base ID.

## Headers

- `Authorization` string, required

## Request body

- object
  - `name` string — Source name.
  - `type` 'pdf' | 'text' | 'web' — Source type.
  - `url` string — Source URL. Required when type is `pdf` (URL to a hosted PDF file) or `web` (URL to a website to scrape)
  - `content` string — The full text content for the knowledge base source. Required when type is `text`

## Response `200`

200

- AttachDocumentToSourceResponse200
  - `status` string, required
  - `response` KnowledgeBaseKnowledgeBaseIdSourcesPostResponsesContentApplicationJsonSchemaResponse, required
    - `source_id` string, required — Unique identifier of the created source.

---

[API](https://skmtc.net/synthflow/apis/platform-api.md) · [All operations](https://skmtc.net/synthflow/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/synthflow/platform-api/versions/decb652b52e0/schema)
