Python SDK
import httpx
resp = httpx.post(
"https://api.decimal.ai/api/v1/datasets/ds_abc123/build",
headers={"Authorization": "Bearer dai_sk_..."},
json={"allowed_verdicts": ["keep"], "min_eval_score": 0.7},
)
resp.raise_for_status()
print(resp.json()["version_id"], resp.json()["row_count"])decimalai datasets build ds_abc123 --verdict keepconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.decimal.ai/api/v1/datasets/{dataset_id}/build', 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.decimal.ai/api/v1/datasets/{dataset_id}/build",
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: 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.decimal.ai/api/v1/datasets/{dataset_id}/build"
payload := strings.NewReader("{}")
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.decimal.ai/api/v1/datasets/{dataset_id}/build")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/datasets/{dataset_id}/build")
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 = "{}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"version_id": "dv_002",
"version_number": 2,
"row_count": 1250,
"version_status": "ready",
"quality_report": {
"avg_score": 0.87,
"drop_rate": 0.05
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}datasets
Build a new dataset version from traces
Build a new dataset version from traces.
payload is an OPTIONAL filter envelope (trace_ids / agent_name / verdicts / …); an empty body
means an unfiltered build of the whole dataset. Default it to {} (matching the sibling
validate_version route) so a no-body POST builds-unfiltered instead of 422-ing on a missing body.
POST
/
api
/
v1
/
datasets
/
{dataset_id}
/
build
Python SDK
import httpx
resp = httpx.post(
"https://api.decimal.ai/api/v1/datasets/ds_abc123/build",
headers={"Authorization": "Bearer dai_sk_..."},
json={"allowed_verdicts": ["keep"], "min_eval_score": 0.7},
)
resp.raise_for_status()
print(resp.json()["version_id"], resp.json()["row_count"])decimalai datasets build ds_abc123 --verdict keepconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.decimal.ai/api/v1/datasets/{dataset_id}/build', 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.decimal.ai/api/v1/datasets/{dataset_id}/build",
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: 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.decimal.ai/api/v1/datasets/{dataset_id}/build"
payload := strings.NewReader("{}")
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.decimal.ai/api/v1/datasets/{dataset_id}/build")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.decimal.ai/api/v1/datasets/{dataset_id}/build")
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 = "{}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"version_id": "dv_002",
"version_number": 2,
"row_count": 1250,
"version_status": "ready",
"quality_report": {
"avg_score": 0.87,
"drop_rate": 0.05
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}⌘I