Bulk Create Evaluation Set Items
curl --request POST \
--url https://api-prod.extend.app/evaluation_set_items/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"evaluationSetId": "<string>",
"items": [
{}
]
}
'import requests
url = "https://api-prod.extend.app/evaluation_set_items/bulk"
payload = {
"evaluationSetId": "<string>",
"items": [{}]
}
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({evaluationSetId: '<string>', items: [{}]})
};
fetch('https://api-prod.extend.app/evaluation_set_items/bulk', 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-prod.extend.app/evaluation_set_items/bulk",
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([
'evaluationSetId' => '<string>',
'items' => [
[
]
]
]),
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-prod.extend.app/evaluation_set_items/bulk"
payload := strings.NewReader("{\n \"evaluationSetId\": \"<string>\",\n \"items\": [\n {}\n ]\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-prod.extend.app/evaluation_set_items/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"evaluationSetId\": \"<string>\",\n \"items\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.extend.app/evaluation_set_items/bulk")
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 \"evaluationSetId\": \"<string>\",\n \"items\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"evaluationSetItems": [
{
"object": "evaluation_set_item",
"id": "eval_item_1234",
"evaluationSetId": "eval_set_1234",
"fileId": "file_1234",
"expectedOutput": {
// Output object - see “Processor output types” for details
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
},
{
"object": "evaluation_set_item",
"id": "eval_item_5678",
"evaluationSetId": "eval_set_5678",
"fileId": "file_5678",
"expectedOutput": {
// Output object - see “Processor output types” for details
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}
Evaluation Set Endpoints
Bulk Create Evaluation Set Items
Create evaluation set items for a given evaluation set in bulk.
Bulk Create Evaluation Set Items
curl --request POST \
--url https://api-prod.extend.app/evaluation_set_items/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"evaluationSetId": "<string>",
"items": [
{}
]
}
'import requests
url = "https://api-prod.extend.app/evaluation_set_items/bulk"
payload = {
"evaluationSetId": "<string>",
"items": [{}]
}
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({evaluationSetId: '<string>', items: [{}]})
};
fetch('https://api-prod.extend.app/evaluation_set_items/bulk', 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-prod.extend.app/evaluation_set_items/bulk",
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([
'evaluationSetId' => '<string>',
'items' => [
[
]
]
]),
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-prod.extend.app/evaluation_set_items/bulk"
payload := strings.NewReader("{\n \"evaluationSetId\": \"<string>\",\n \"items\": [\n {}\n ]\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-prod.extend.app/evaluation_set_items/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"evaluationSetId\": \"<string>\",\n \"items\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-prod.extend.app/evaluation_set_items/bulk")
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 \"evaluationSetId\": \"<string>\",\n \"items\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"evaluationSetItems": [
{
"object": "evaluation_set_item",
"id": "eval_item_1234",
"evaluationSetId": "eval_set_1234",
"fileId": "file_1234",
"expectedOutput": {
// Output object - see “Processor output types” for details
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
},
{
"object": "evaluation_set_item",
"id": "eval_item_5678",
"evaluationSetId": "eval_set_5678",
"fileId": "file_5678",
"expectedOutput": {
// Output object - see “Processor output types” for details
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}
If you have a large number of files that you need to add to an evaluation set, you can use this endpoint to create multiple evaluation set items at once. This can be useful if you have a large dataset that you need to evaluate the performance of a processor against.
Note: you still need to create each File first using the file API.
Body
string
required
The ID of the evaluation set to add the items to.
array
required
An array of objects representing the evaluation set items to create. Each object should have the following fields:
Hide properties
Hide properties
string
The ID of the file to add to the evaluation set.
object
The expected output of the processor when run against the file. This should be a JSON object conforming to the output type schema of the processor.
Response
{
"success": true,
"evaluationSetItems": [
{
"object": "evaluation_set_item",
"id": "eval_item_1234",
"evaluationSetId": "eval_set_1234",
"fileId": "file_1234",
"expectedOutput": {
// Output object - see “Processor output types” for details
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
},
{
"object": "evaluation_set_item",
"id": "eval_item_5678",
"evaluationSetId": "eval_set_5678",
"fileId": "file_5678",
"expectedOutput": {
// Output object - see “Processor output types” for details
},
"createdAt": "2024-01-01T00:00:00Z",
"updatedAt": "2024-01-01T00:00:00Z"
}
]
}

