---
title: "Update a knowledge base source"
method: PUT
path: "/knowledge_base/{knowledge_base_id}/sources/{source_id}"
---

# Update a knowledge base source

`PUT /knowledge_base/{knowledge_base_id}/sources/{source_id}`

Update an existing knowledge base source by source ID. The updatable fields depend on the existing source type:

- `link` / `file`: `url`
- `text`: `content`

You can always update `name`.

## Path parameters

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

## Headers

- `Authorization` string, required

## Request body

- union
  - UpdateKnowledgeBaseSourceRequest0
    - `name` string — Updated source name.
    - `url` string, required — Updated URL for `link` sources.
  - UpdateKnowledgeBaseSourceRequest1
    - `name` string — Updated source name.
    - `url` string, required — Updated URL for `file` sources.
  - UpdateKnowledgeBaseSourceRequest2
    - `name` string — Updated source name.
    - `content` string, required — Updated text body for `text` sources.

## Response `200`

200

- UpdateKnowledgeBaseSourceResponse200
  - `status` string
  - `response` KnowledgeBaseKnowledgeBaseIdSourcesSourceIdPutResponsesContentApplicationJsonSchemaResponse
    - `source_id` string — Source ID.

## Other responses

- `400` — 400

---

[API](https://skmtc.dev/synthflow/apis/platform-api.md) · [All operations](https://skmtc.dev/synthflow/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/synthflow/platform-api/revisions/6976456ad422/schema)
