Manage data sources and documents¶
Add, preview, query, or delete data sources in an existing knowledge base, and view related documents and processed artifacts. This page does not create knowledge bases or modify segment content.
Prerequisites¶
Prepare credentials that can access the target workspace and the target knowledge base ID. For service endpoints, authentication, and general request formats, see Prepare to call an API.
If data comes from a local file, select the upload action that matches when you are creating the knowledge base. A successful upload does not mean the data source has been added to the knowledge base.
Call sequence¶
First list data sources to confirm existing data sources in the target knowledge base.
To upload a local file, choose the upload action based on whether it is before knowledge-base creation, and retain file or data-source information returned by that action page.
Preview data sources to add before adding them. After confirming the preview, add data.
After adding, query data sources, documents, or processed artifacts to confirm observable results. To remove data, delete it with the target data-source ID.
API operations¶
Upload, preview, and add data sources¶
What you need to do |
API operation |
Use it when |
|---|---|---|
Upload local files before creation |
Prepare local files before creating a knowledge base. |
|
Upload local files |
Prepare local files for an existing knowledge base. |
|
Preview data sources to add |
Check input before adding data sources to an existing knowledge base. |
|
Preview data sources at creation |
Check input before providing data sources at knowledge-base creation. |
|
Add data sources |
Add data sources to the target knowledge base after confirming the preview. |
|
Backfill historical data-source relationships |
Complete historical data-source relationships. |
Query, preview, and maintain data sources¶
What you need to do |
API operation |
Use it when |
|---|---|---|
Check whether a data source is added |
Confirm the relationship for a specified data source before or after adding it. |
|
Query data sources |
Obtain data sources and their IDs in the target knowledge base. |
|
Query document details |
You have a document ID and need to view the document. |
|
Preview a source file |
Inspect a data source’s original file. |
|
Preview a processed artifact |
Inspect a data source’s processing result. |
|
Update data-source governance settings |
You identified a target data source and need to adjust governance settings. |
|
Delete a data source |
Confirm impact and conditions on the action page before deletion. |
Confirm the result¶
After adding or updating, use List data sources to confirm data-source relationships. To verify content, use Get document details, Preview a source file, or Preview a processed artifact image.
Limitations and notes¶
Deleting a data source affects that source in the target knowledge base. Confirm conditions and results in Delete data before proceeding.