POST
/
api
/
datasets
curl --request POST \
  --url https://app.pathors.com/api/datasets \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '{}'

Create Dataset

Creates and embeds a new dataset into your specified knowledgebase.

Upload Dataset

Path Parameters

knowledgebaseId
string
required

The ID of the knowledgebase to add the dataset to

Headers

x-api-key
string
required

Your project API key for authentication

Request Body

The request should be sent as multipart/form-data with the following field:

dataset
file
required

The dataset file to be uploaded and embedded

Example request using curl:

curl -X POST \
  -H "x-api-key: your-api-key" \
  -F "dataset=@/path/to/your/file.pdf" \
  https://api.pathors.com/api/datasets

Response

A successful request will return a 201 status code indicating the dataset was created successfully.

Processing

When a dataset is uploaded:

  1. The file is stored securely
  2. The content is chunked into manageable segments
  3. Each chunk is embedded using the knowledgebase’s configured embedding model
  4. The embeddings are stored for future querying

Supported File Types

The following file extensions are supported:

  • PDF (.pdf)
  • Text (.txt)

Error Responses

Status CodeDescription
400Invalid request or unsupported file type
401Invalid API key
404Knowledgebase not found
413File too large
500Internal server error

Usage Notes

  • Large files may take longer to process due to the embedding process
  • The maximum file size limit is 10MB
  • Files are processed asynchronously - use the Get Dataset endpoint to check processing status
  • Each dataset is automatically split into chunks for optimal retrieval