Upload Text Dataset Items
curl --request POST \
--url https://api.example.com/api/uploads/dataset/{dataset_id}/text \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_name": "<string>",
"branch_name": "<string>",
"s3_url": "<string>",
"documents": [
{
"id": "<string>",
"title": "<string>",
"text": "<string>",
"content_base64": "<string>",
"mime_type": "<string>"
}
],
"off_topic_collective": true,
"webhook_url": "<string>",
"webhook_on_complete": true,
"webhook_on_failure": true,
"repo_url": "<string>",
"repo_access_token": "<string>"
}
'import requests
url = "https://api.example.com/api/uploads/dataset/{dataset_id}/text"
payload = {
"dataset_name": "<string>",
"branch_name": "<string>",
"s3_url": "<string>",
"documents": [
{
"id": "<string>",
"title": "<string>",
"text": "<string>",
"content_base64": "<string>",
"mime_type": "<string>"
}
],
"off_topic_collective": True,
"webhook_url": "<string>",
"webhook_on_complete": True,
"webhook_on_failure": True,
"repo_url": "<string>",
"repo_access_token": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataset_name: '<string>',
branch_name: '<string>',
s3_url: '<string>',
documents: [
{
id: '<string>',
title: '<string>',
text: '<string>',
content_base64: '<string>',
mime_type: '<string>'
}
],
off_topic_collective: true,
webhook_url: '<string>',
webhook_on_complete: true,
webhook_on_failure: true,
repo_url: '<string>',
repo_access_token: '<string>'
})
};
fetch('https://api.example.com/api/uploads/dataset/{dataset_id}/text', 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.example.com/api/uploads/dataset/{dataset_id}/text",
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([
'dataset_name' => '<string>',
'branch_name' => '<string>',
's3_url' => '<string>',
'documents' => [
[
'id' => '<string>',
'title' => '<string>',
'text' => '<string>',
'content_base64' => '<string>',
'mime_type' => '<string>'
]
],
'off_topic_collective' => true,
'webhook_url' => '<string>',
'webhook_on_complete' => true,
'webhook_on_failure' => true,
'repo_url' => '<string>',
'repo_access_token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/api/uploads/dataset/{dataset_id}/text"
payload := strings.NewReader("{\n \"dataset_name\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"s3_url\": \"<string>\",\n \"documents\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"off_topic_collective\": true,\n \"webhook_url\": \"<string>\",\n \"webhook_on_complete\": true,\n \"webhook_on_failure\": true,\n \"repo_url\": \"<string>\",\n \"repo_access_token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.example.com/api/uploads/dataset/{dataset_id}/text")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_name\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"s3_url\": \"<string>\",\n \"documents\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"off_topic_collective\": true,\n \"webhook_url\": \"<string>\",\n \"webhook_on_complete\": true,\n \"webhook_on_failure\": true,\n \"repo_url\": \"<string>\",\n \"repo_access_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/uploads/dataset/{dataset_id}/text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_name\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"s3_url\": \"<string>\",\n \"documents\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"off_topic_collective\": true,\n \"webhook_url\": \"<string>\",\n \"webhook_on_complete\": true,\n \"webhook_on_failure\": true,\n \"repo_url\": \"<string>\",\n \"repo_access_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}uploads
Upload Text Dataset Items
POST
/
api
/
uploads
/
dataset
/
{dataset_id}
/
text
Upload Text Dataset Items
curl --request POST \
--url https://api.example.com/api/uploads/dataset/{dataset_id}/text \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_name": "<string>",
"branch_name": "<string>",
"s3_url": "<string>",
"documents": [
{
"id": "<string>",
"title": "<string>",
"text": "<string>",
"content_base64": "<string>",
"mime_type": "<string>"
}
],
"off_topic_collective": true,
"webhook_url": "<string>",
"webhook_on_complete": true,
"webhook_on_failure": true,
"repo_url": "<string>",
"repo_access_token": "<string>"
}
'import requests
url = "https://api.example.com/api/uploads/dataset/{dataset_id}/text"
payload = {
"dataset_name": "<string>",
"branch_name": "<string>",
"s3_url": "<string>",
"documents": [
{
"id": "<string>",
"title": "<string>",
"text": "<string>",
"content_base64": "<string>",
"mime_type": "<string>"
}
],
"off_topic_collective": True,
"webhook_url": "<string>",
"webhook_on_complete": True,
"webhook_on_failure": True,
"repo_url": "<string>",
"repo_access_token": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataset_name: '<string>',
branch_name: '<string>',
s3_url: '<string>',
documents: [
{
id: '<string>',
title: '<string>',
text: '<string>',
content_base64: '<string>',
mime_type: '<string>'
}
],
off_topic_collective: true,
webhook_url: '<string>',
webhook_on_complete: true,
webhook_on_failure: true,
repo_url: '<string>',
repo_access_token: '<string>'
})
};
fetch('https://api.example.com/api/uploads/dataset/{dataset_id}/text', 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.example.com/api/uploads/dataset/{dataset_id}/text",
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([
'dataset_name' => '<string>',
'branch_name' => '<string>',
's3_url' => '<string>',
'documents' => [
[
'id' => '<string>',
'title' => '<string>',
'text' => '<string>',
'content_base64' => '<string>',
'mime_type' => '<string>'
]
],
'off_topic_collective' => true,
'webhook_url' => '<string>',
'webhook_on_complete' => true,
'webhook_on_failure' => true,
'repo_url' => '<string>',
'repo_access_token' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.example.com/api/uploads/dataset/{dataset_id}/text"
payload := strings.NewReader("{\n \"dataset_name\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"s3_url\": \"<string>\",\n \"documents\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"off_topic_collective\": true,\n \"webhook_url\": \"<string>\",\n \"webhook_on_complete\": true,\n \"webhook_on_failure\": true,\n \"repo_url\": \"<string>\",\n \"repo_access_token\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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.example.com/api/uploads/dataset/{dataset_id}/text")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_name\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"s3_url\": \"<string>\",\n \"documents\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"off_topic_collective\": true,\n \"webhook_url\": \"<string>\",\n \"webhook_on_complete\": true,\n \"webhook_on_failure\": true,\n \"repo_url\": \"<string>\",\n \"repo_access_token\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/uploads/dataset/{dataset_id}/text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_name\": \"<string>\",\n \"branch_name\": \"<string>\",\n \"s3_url\": \"<string>\",\n \"documents\": [\n {\n \"id\": \"<string>\",\n \"title\": \"<string>\",\n \"text\": \"<string>\",\n \"content_base64\": \"<string>\",\n \"mime_type\": \"<string>\"\n }\n ],\n \"off_topic_collective\": true,\n \"webhook_url\": \"<string>\",\n \"webhook_on_complete\": true,\n \"webhook_on_failure\": true,\n \"repo_url\": \"<string>\",\n \"repo_access_token\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
Query Parameters
Cookies
Body
application/json
Show child attributes
Show child attributes
Response
Successful Response
⌘I

