Skip to main content
POST
Create a new datasource

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

knowledge_id
string
required

The unique identifier of the knowledge base

Body

application/json

The request body for creating a new datasource. If file_id is provided, the file is immediately queued for chunking.

display_name
string

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.

description
string | null

The description of the knowledge base

metadata
object

Client-defined metadata associated with the datasource.

file_id
string

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

chunking_options
object

Configuration options specifying how the datasource file is chunked. Required if file_id is specified. Defaults to standard chunking options if omitted.

Response

Datasource successfully created

display_name
string
required

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

status
enum<string>
required
Available options:
pending,
processing,
completed,
failed,
queued
created
string
required

The date and time the datasource was created

updated
string
required

The date and time the datasource was updated

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
_id
string<ulid>
default:01KZKJHSMGAAHEA6FE2DZD4V39
read-only

The unique identifier of the data source

Pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
description
string | null

The description of the knowledge base

file_id
string | null

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

created_by_id
string | null

The user ID of the creator of the knowledge base

update_by_id
string | null

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