Create Dataset
curl --request POST \
--url https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '{}'import requests
url = "https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets"
payload = {}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({})
};
fetch('https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{}"
response = http.request(request)
puts response.read_bodyCreate Dataset
Upload a file and create a dataset in a knowledgebase
POST
/
v1
/
projects
/
{projectId}
/
knowledgebases
/
{knowledgebaseId}
/
datasets
Create Dataset
curl --request POST \
--url https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '{}'import requests
url = "https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets"
payload = {}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({})
};
fetch('https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{}"
response = http.request(request)
puts response.read_bodyUploads a file as a new dataset. The file is chunked and embedded asynchronously after upload — poll List Datasets and watch
isParsed to know when it’s ready for query.
Request
POST https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/datasets
Path Parameters
string
required
The project ID
string
required
The knowledgebase to upload into
Headers
string
required
Bearer token using your developer key
string
required
Must be
multipart/form-dataBody
file
required
The file to upload. Supported formats: PDF, TXT, DOCX, and other text-based formats.
Response
{
"message": "Dataset Uploaded successfully, currently embedding in the background",
"success": true
}
Example
curl -X POST https://api.pathors.com/v1/projects/{projectId}/knowledgebases/kb_abc123/datasets \
-H "Authorization: Bearer dk_your_key" \
-F "dataset=@/path/to/your/file.pdf"
⌘I
