Skip to main content
POST
/
v2
/
knowledge
/
{knowledge_id}
/
datasources
Create a new datasource
curl --request POST \
  --url https://api.orq.ai/v2/knowledge/{knowledge_id}/datasources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "display_name": "<string>",
  "file_id": "<string>",
  "chunking_options": {
    "chunking_configuration": {
      "type": "default"
    },
    "chunking_cleanup_options": {
      "delete_emails": true,
      "delete_credit_cards": true,
      "delete_phone_numbers": true,
      "clean_bullet_points": true,
      "clean_numbered_list": true,
      "clean_unicode": true,
      "clean_dashes": true,
      "clean_whitespaces": true
    }
  }
}'
{
  "_id": "01K8VCCVAMGBYQ8ZX32EWBC9DJ",
  "display_name": "<string>",
  "description": "<string>",
  "status": "pending",
  "file_id": "<string>",
  "created": "<string>",
  "updated": "<string>",
  "created_by_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "update_by_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "knowledge_id": "<string>",
  "chunks_count": 123
}

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
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.

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

_id
string<ulid>
default:01K8VCCVAMGBYQ8ZX32EWBC9DJ

The unique identifier of the data source

description
string

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<uuid> | null

The user ID of the creator of the knowledge base

update_by_id
string<uuid> | null

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