---
title: "Update a datasource"
method: PATCH
path: "/v2/knowledge/{knowledge_id}/datasources/{datasource_id}"
tags: ["Knowledge Bases"]
---

# Update a datasource

`PATCH /v2/knowledge/{knowledge_id}/datasources/{datasource_id}`

## Path parameters

- `knowledge_id` string, required — The unique identifier of the knowledge base
- `datasource_id` string, required — The unique identifier of the datasource.

## Request body

- object
  - `display_name` string, required

## Response `200`

Datasource successfully updated

- object
  - `_id` string, ulid — The unique identifier of the data source
  - `display_name` string, required — The display name of the datasource. Normally the name of the uploaded file
  - `description` string, nullable — The description of the knowledge base
  - `status` 'pending' | 'processing' | 'completed' | 'failed' | 'queued', required
  - `file_id` string, nullable — The unique identifier of the file used to create the datasource.
  - `created` string, required — The date and time the datasource was created
  - `updated` string, required — The date and time the datasource was updated
  - `created_by_id` string, nullable — The user ID of the creator of the knowledge base
  - `update_by_id` string, nullable — The user ID of the last user who updated the knowledge base
  - `knowledge_id` string, required — The unique identifier of the knowledge base
  - `chunks_count` number, required — The number of chunks in the datasource
  - `metadata` object, required
    - `words_count` number — Number of words in the text
    - `sentences_count` number — Number of sentences in the text
    - `paragraphs_count` number — Number of paragraphs in the text
    - `tokens_count` number — Number of tokens in the text
    - `characters_count` number — Number of characters in the text
    - `chunks_count` number — Number of total chunks

---

[API](https://skmtc.net/orq-ai/apis/orq-ai-api.md) · [All operations](https://skmtc.net/orq-ai/apis/orq-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/orq-ai/orq-ai-api/revisions/deb8d376faee/schema)
