Datasets
Create Dataset
Create a new dataset to store and organize documents
POST
/
v1
/
datasets
Create Dataset
curl --request POST \
--url https://api.fltr.com/v1/datasets \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "<string>",
"description": "<string>",
"is_public": true,
"metadata": {}
}
'import requests
url = "https://api.fltr.com/v1/datasets"
payload = {
"name": "<string>",
"description": "<string>",
"is_public": True,
"metadata": {}
}
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({name: '<string>', description: '<string>', is_public: true, metadata: {}})
};
fetch('https://api.fltr.com/v1/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.fltr.com/v1/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([
'name' => '<string>',
'description' => '<string>',
'is_public' => true,
'metadata' => [
]
]),
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.fltr.com/v1/datasets"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": true,\n \"metadata\": {}\n}")
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.fltr.com/v1/datasets")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fltr.com/v1/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 = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"400": {},
"401": {},
"429": {},
"id": "<string>",
"name": "<string>",
"description": "<string>",
"is_public": true,
"document_count": 123,
"created_at": "<string>",
"updated_at": "<string>",
"metadata": {}
}Request
Creates a new dataset. Datasets are containers for related documents that can be searched together.Headers
string
required
Bearer token for authenticationExample:
Bearer fltr_sk_abc123...string
required
Must be
application/jsonBody
string
required
Name of the dataset (1-200 characters)
string
Optional description (max 1000 characters)
boolean
default:false
Whether the dataset is publicly accessible
object
Custom metadata as key-value pairs
Response
string
Unique dataset identifier (e.g.,
ds_abc123)string
Dataset name
string
Dataset description
boolean
Public accessibility status
integer
Number of documents (always 0 for new datasets)
string
ISO 8601 timestamp of creation
string
ISO 8601 timestamp of last update
object
Custom metadata
Examples
curl -X POST https://api.fltr.com/v1/datasets \
-H "Authorization: Bearer fltr_sk_abc123..." \
-H "Content-Type: application/json" \
-d '{
"name": "Product Documentation",
"description": "All product docs and guides",
"is_public": false,
"metadata": {
"category": "documentation",
"team": "product"
}
}'
import requests
response = requests.post(
"https://api.fltr.com/v1/datasets",
headers={
"Authorization": "Bearer fltr_sk_abc123...",
"Content-Type": "application/json"
},
json={
"name": "Product Documentation",
"description": "All product docs and guides",
"is_public": False,
"metadata": {
"category": "documentation",
"team": "product"
}
}
)
dataset = response.json()
print(f"Created dataset: {dataset['id']}")
const response = await fetch("https://api.fltr.com/v1/datasets", {
method: "POST",
headers: {
"Authorization": "Bearer fltr_sk_abc123...",
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Product Documentation",
description: "All product docs and guides",
is_public: false,
metadata: {
category: "documentation",
team: "product"
}
})
});
const dataset = await response.json();
console.log(`Created dataset: ${dataset.id}`);
Response
{
"id": "ds_abc123def456",
"name": "Product Documentation",
"description": "All product docs and guides",
"is_public": false,
"document_count": 0,
"created_at": "2024-01-10T12:00:00Z",
"updated_at": "2024-01-10T12:00:00Z",
"metadata": {
"category": "documentation",
"team": "product"
}
}
Errors
error
Bad Request - Invalid parameters
{
"error": "Invalid dataset name",
"code": "invalid_name",
"details": {
"field": "name",
"issue": "Name cannot be empty"
}
}
error
Unauthorized - Invalid or missing API key
{
"error": "Invalid API key",
"code": "invalid_api_key"
}
error
Rate Limit Exceeded
{
"error": "Rate limit exceeded",
"code": "rate_limit_exceeded",
"retry_after": 3600
}
Notes
- Dataset names must be unique within your account
- Maximum 1,000 datasets per account
- Use
is_public: trueto make datasets accessible without authentication (read-only) - Metadata is indexed and searchable
- Deleting a dataset also deletes all its documents
⌘I
Create Dataset
curl --request POST \
--url https://api.fltr.com/v1/datasets \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"name": "<string>",
"description": "<string>",
"is_public": true,
"metadata": {}
}
'import requests
url = "https://api.fltr.com/v1/datasets"
payload = {
"name": "<string>",
"description": "<string>",
"is_public": True,
"metadata": {}
}
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({name: '<string>', description: '<string>', is_public: true, metadata: {}})
};
fetch('https://api.fltr.com/v1/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.fltr.com/v1/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([
'name' => '<string>',
'description' => '<string>',
'is_public' => true,
'metadata' => [
]
]),
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.fltr.com/v1/datasets"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": true,\n \"metadata\": {}\n}")
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.fltr.com/v1/datasets")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": true,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fltr.com/v1/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 = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"is_public\": true,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"400": {},
"401": {},
"429": {},
"id": "<string>",
"name": "<string>",
"description": "<string>",
"is_public": true,
"document_count": 123,
"created_at": "<string>",
"updated_at": "<string>",
"metadata": {}
}