Commit Benchmark Task Append
curl --request POST \
--url https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit', 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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"bench_id": "<string>",
"batch_id": "<string>",
"added_count": 123,
"updated_count": 123,
"skipped_count": 123,
"task_count": 123,
"failed_tasks": [
{
"task_id": "<string>",
"error": "<string>",
"label": "<string>"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}benchmarks
Commit Benchmark Task Append
Validate the batch’s staged tasks, publish new tasks, and replace live tasks whose names are stored with different content in one transaction. Task names already stored with identical content are skipped, so committing the same batch twice is a no-op.
POST
/
api
/
v1
/
benchmarks
/
{bench_id}
/
tasks:append
/
{batch_id}
/
commit
Commit Benchmark Task Append
curl --request POST \
--url https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit', 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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trajectory.ai/api/v1/benchmarks/{bench_id}/tasks:append/{batch_id}/commit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"bench_id": "<string>",
"batch_id": "<string>",
"added_count": 123,
"updated_count": 123,
"skipped_count": 123,
"task_count": 123,
"failed_tasks": [
{
"task_id": "<string>",
"error": "<string>",
"label": "<string>"
}
]
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"context": {},
"param": "<string>"
}
}Authorizations
Organization API key
⌘I