v172

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-0826148911.7 MB
Knowledge Bases

Create a new datasource

post/v2/knowledge/{knowledge_id}/datasources

Path parameters

knowledge_idstring required

The unique identifier of the knowledge base

The unique identifier of the knowledge base

Request body

display_namestring

The display name for the datasource visible in the UI. If omitted, the display name is derived from the uploaded file. When both display_name and file_id are provided, the provided display_name is prioritized.

descriptionstring nullable

The description of the knowledge base

metadataobject

Client-defined metadata associated with the datasource.

file_idstring

The unique identifier of the file used for datasource creation. If provided, the file is immediately queued for chunking.

Response

Datasource successfully created

_idstring ulid

The unique identifier of the data source

display_namestring required

The display name of the datasource. Normally the name of the uploaded file

descriptionstring nullable

The description of the knowledge base

status'pending' | 'processing' | 'completed' | 'failed' | 'queued' required
file_idstring nullable

The unique identifier of the file used to create the datasource.

createdstring required

The date and time the datasource was created

updatedstring required

The date and time the datasource was updated

created_by_idstring nullable

The user ID of the creator of the knowledge base

update_by_idstring nullable

The user ID of the last user who updated the knowledge base

knowledge_idstring required

The unique identifier of the knowledge base

chunks_countnumber required

The number of chunks in the datasource