Bulk Create Scores
Create multiple scores on a single source in one request.
Bulk Create Scores
Create multiple annotation scores on a single source in one request. Each score in the batch uses a different label. The endpoint returns successfully created scores alongside any errors.
POST
https://api.futureagi.com/model-hub/scores/bulk/
Bearer
Click "Try It" to send a request
Authentication
All requests require authentication via API keys:
| Header | Description |
|---|---|
X-Api-Key | Your API key |
X-Secret-Key | Your secret key |
Request Body
source_type string Required The type of source to annotate. One of trace, span, generation, or session.
source_id string Required UUID of the source object to annotate.
scores array Required Array of score objects to create. Each object contains:
label_id(string, required) — UUID of the annotation label.value(object, required) — The score value as JSON.score_source(string, optional) — Origin of the score. Defaults to"human".
notes string Optional freeform notes applied to all scores in the batch.
Response
scores array Array of successfully created Score objects. Each object has the same shape as the single create endpoint response (id, source_type, source_id, label_id, label_name, label_type, value, score_source, notes, annotator, annotator_name, annotator_email, queue_item, created_at, updated_at).
errors array Array of error strings for any scores that failed to create.
Code Examples
import requests
url = "https://api.futureagi.com/model-hub/scores/bulk/"
headers = {
"X-Api-Key": "YOUR_API_KEY",
"X-Secret-Key": "YOUR_SECRET_KEY",
"Content-Type": "application/json",
}
payload = {
"source_type": "trace",
"source_id": "your-source-uuid",
"scores": [
{"label_id": "label-uuid-1", "value": {"rating": 4}, "score_source": "human"},
{"label_id": "label-uuid-2", "value": {"selected": ["positive"]}, "score_source": "human"},
],
"notes": "Batch annotation",
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(f"Created: {len(data['scores'])} scores")
if data["errors"]:
print(f"Errors: {data['errors']}")const response = await fetch("https://api.futureagi.com/model-hub/scores/bulk/", {
method: "POST",
headers: {
"X-Api-Key": "YOUR_API_KEY",
"X-Secret-Key": "YOUR_SECRET_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
sourceType: "trace",
sourceId: "your-source-uuid",
scores: [
{ labelId: "label-uuid-1", value: { rating: 4 }, scoreSource: "human" },
{ labelId: "label-uuid-2", value: { selected: ["positive"] }, scoreSource: "human" },
],
notes: "Batch annotation",
}),
});
const data = await response.json();
console.log(`Created: ${data.scores.length} scores`);
if (data.errors.length) {
console.error("Errors:", data.errors);
}curl -X POST https://api.futureagi.com/model-hub/scores/bulk/ \
-H "X-Api-Key: YOUR_API_KEY" \
-H "X-Secret-Key: YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"source_type": "trace",
"source_id": "your-source-uuid",
"scores": [
{"label_id": "label-uuid-1", "value": {"rating": 4}, "score_source": "human"},
{"label_id": "label-uuid-2", "value": {"selected": ["positive"]}, "score_source": "human"}
],
"notes": "Batch annotation"
}' Was this page helpful?