Skip to main content
POST
/
api
/
knowledgebases
/
{knowledgebaseId}
/
datasets
Create Dataset
curl --request POST \
  --url https://app.pathors.com/api/knowledgebases/{knowledgebaseId}/datasets \
  --header 'Content-Type: <content-type>' \
  --header 'x-api-key: <x-api-key>' \
  --data '{}'
{
  "message": "<string>",
  "success": true
}
Upload and create a new dataset in a specific knowledgebase. The dataset will be processed and embedded for semantic search.

Endpoint

POST /api/knowledgebases/{knowledgebaseId}/datasets

Path Parameters

knowledgebaseId
string
required
The unique identifier of the knowledgebase where the dataset will be created

Headers

x-api-key
string
required
Your project API key for authentication
Content-Type
string
required
Must be multipart/form-data

Request Body

dataset
file
required
The dataset file to upload. Supported formats: PDF, TXT, DOCX, and other text-based formats
Example request:
curl -X POST \
  -H "x-api-key: your_api_key" \
  -F "dataset=@/path/to/your/file.pdf" \
  https://your-domain.com/api/knowledgebases/kb_abc123/datasets

Response

Returns a success message indicating the dataset was uploaded and is being processed.
message
string
Success message describing the upload status
success
boolean
Indicates whether the upload was successful
Example response:
{
  "message": "Dataset Uploaded successfully, currently embedding in the background",
  "success": true
}

Processing Flow

  1. Upload Validation: The file is validated for format and size
  2. Knowledgebase Verification: Ensures the knowledgebase exists and belongs to your project
  3. File Storage: The dataset is stored in the system
  4. Background Processing: The dataset is processed and embedded asynchronously
  5. Chunking: The content is split into searchable chunks
  6. Embedding: Chunks are converted to vector embeddings for semantic search

Supported File Formats

  • PDF documents
  • Plain text files (.txt)
  • Microsoft Word documents (.docx)
  • Other text-based formats

Error Responses

Status CodeDescription
400Invalid request (missing file, invalid format, or knowledgebase ID)
401Invalid API key
404Knowledgebase not found or access denied
500Internal server error

Usage Notes

  • Processing happens asynchronously after upload
  • Large files may take several minutes to process
  • You can check processing status through the datasets listing endpoint
  • The knowledgebase must exist and belong to your project
  • File size limits apply (check your plan limits)