Create Samples Batch
curl --request POST \
--url https://api.heybee.app/v1/experiments/{experiment_id}/samples/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"samples": [
{
"anchor_value": "Hello, how are you?",
"file_path": "experiments/exp123/sample456.mp3",
"is_exam_only": false,
"parameters": {
"model": "v2",
"temperature": 0.7
},
"suggestion_id": "550e8400-e29b-41d4-a716-446655440000"
}
]
}
'import requests
url = "https://api.heybee.app/v1/experiments/{experiment_id}/samples/batch"
payload = { "samples": [
{
"anchor_value": "Hello, how are you?",
"file_path": "experiments/exp123/sample456.mp3",
"is_exam_only": False,
"parameters": {
"model": "v2",
"temperature": 0.7
},
"suggestion_id": "550e8400-e29b-41d4-a716-446655440000"
}
] }
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({
samples: [
{
anchor_value: 'Hello, how are you?',
file_path: 'experiments/exp123/sample456.mp3',
is_exam_only: false,
parameters: {model: 'v2', temperature: 0.7},
suggestion_id: '550e8400-e29b-41d4-a716-446655440000'
}
]
})
};
fetch('https://api.heybee.app/v1/experiments/{experiment_id}/samples/batch', 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.heybee.app/v1/experiments/{experiment_id}/samples/batch",
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([
'samples' => [
[
'anchor_value' => 'Hello, how are you?',
'file_path' => 'experiments/exp123/sample456.mp3',
'is_exam_only' => false,
'parameters' => [
'model' => 'v2',
'temperature' => 0.7
],
'suggestion_id' => '550e8400-e29b-41d4-a716-446655440000'
]
]
]),
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.heybee.app/v1/experiments/{experiment_id}/samples/batch"
payload := strings.NewReader("{\n \"samples\": [\n {\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"is_exam_only\": false,\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\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.heybee.app/v1/experiments/{experiment_id}/samples/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"samples\": [\n {\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"is_exam_only\": false,\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heybee.app/v1/experiments/{experiment_id}/samples/batch")
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 \"samples\": [\n {\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"is_exam_only\": false,\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"page": 123,
"page_size": 123,
"samples": [
{
"anchor_value": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"experiment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_path": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parameters": {},
"anchor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"anchor_text": "<string>",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"availability_status": "active",
"candidate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"candidate_key": "<string>",
"candidate_label": "<string>",
"candidate_metadata": {},
"comparisons": 123,
"content": {},
"content_hash": "<string>",
"content_origin": "local_storage",
"elo_rating": 123,
"file_url": "<string>",
"ingestion_batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_exam_only": false,
"losses": 123,
"mean_score": 123,
"remote": {},
"score_count": 0,
"source_kind": "local",
"source_manifest_row": 123,
"source_sample_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suggestion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thumbnail_url": "<string>",
"wins": 123
}
],
"total": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Samples
Create Samples Batch
Create multiple samples in a single request (max 100).
POST
/
v1
/
experiments
/
{experiment_id}
/
samples
/
batch
Create Samples Batch
curl --request POST \
--url https://api.heybee.app/v1/experiments/{experiment_id}/samples/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"samples": [
{
"anchor_value": "Hello, how are you?",
"file_path": "experiments/exp123/sample456.mp3",
"is_exam_only": false,
"parameters": {
"model": "v2",
"temperature": 0.7
},
"suggestion_id": "550e8400-e29b-41d4-a716-446655440000"
}
]
}
'import requests
url = "https://api.heybee.app/v1/experiments/{experiment_id}/samples/batch"
payload = { "samples": [
{
"anchor_value": "Hello, how are you?",
"file_path": "experiments/exp123/sample456.mp3",
"is_exam_only": False,
"parameters": {
"model": "v2",
"temperature": 0.7
},
"suggestion_id": "550e8400-e29b-41d4-a716-446655440000"
}
] }
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({
samples: [
{
anchor_value: 'Hello, how are you?',
file_path: 'experiments/exp123/sample456.mp3',
is_exam_only: false,
parameters: {model: 'v2', temperature: 0.7},
suggestion_id: '550e8400-e29b-41d4-a716-446655440000'
}
]
})
};
fetch('https://api.heybee.app/v1/experiments/{experiment_id}/samples/batch', 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.heybee.app/v1/experiments/{experiment_id}/samples/batch",
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([
'samples' => [
[
'anchor_value' => 'Hello, how are you?',
'file_path' => 'experiments/exp123/sample456.mp3',
'is_exam_only' => false,
'parameters' => [
'model' => 'v2',
'temperature' => 0.7
],
'suggestion_id' => '550e8400-e29b-41d4-a716-446655440000'
]
]
]),
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.heybee.app/v1/experiments/{experiment_id}/samples/batch"
payload := strings.NewReader("{\n \"samples\": [\n {\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"is_exam_only\": false,\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\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.heybee.app/v1/experiments/{experiment_id}/samples/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"samples\": [\n {\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"is_exam_only\": false,\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heybee.app/v1/experiments/{experiment_id}/samples/batch")
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 \"samples\": [\n {\n \"anchor_value\": \"Hello, how are you?\",\n \"file_path\": \"experiments/exp123/sample456.mp3\",\n \"is_exam_only\": false,\n \"parameters\": {\n \"model\": \"v2\",\n \"temperature\": 0.7\n },\n \"suggestion_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"page": 123,
"page_size": 123,
"samples": [
{
"anchor_value": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"experiment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"file_path": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parameters": {},
"anchor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"anchor_text": "<string>",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"availability_status": "active",
"candidate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"candidate_key": "<string>",
"candidate_label": "<string>",
"candidate_metadata": {},
"comparisons": 123,
"content": {},
"content_hash": "<string>",
"content_origin": "local_storage",
"elo_rating": 123,
"file_url": "<string>",
"ingestion_batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_exam_only": false,
"losses": 123,
"mean_score": 123,
"remote": {},
"score_count": 0,
"source_kind": "local",
"source_manifest_row": 123,
"source_sample_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"suggestion_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thumbnail_url": "<string>",
"wins": 123
}
],
"total": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
BearerAuthApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Request to create multiple samples.
List of samples to create (max 100)
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
⌘I

