Bulk Annotate Spans
Submit annotations and notes for multiple observation spans in a single request.
Bulk Annotate Spans
Submit annotations and notes for up to 1,000 observation spans in a single API call. Supports all label types including text, numeric, star, thumbs, and categorical.
POST
https://api.futureagi.com/tracer/bulk-annotation/
Bearer
Click "Try It" to send a request
Authentication
| Header | Description |
|---|---|
X-Api-Key | Your API key |
X-Secret-Key | Your secret key |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
records | array | Yes | Array of annotation records (max 1,000) |
records[].observation_span_id | UUID | Yes | The observation span to annotate |
records[].annotations | array | No | Annotations for this span (max 20 per record) |
records[].notes | array | No | Notes for this span (max 20 per record) |
Annotation Object
| Field | Type | Required | Description |
|---|---|---|---|
annotation_label_id | UUID | Yes | The annotation label ID |
annotator_id | UUID | Yes | The annotator’s user ID |
value | string | Conditional | Text value (for Text labels) |
value_float | float | Conditional | Numeric value (for Numeric/Star labels) |
value_bool | boolean | Conditional | Boolean value (for Thumbs labels) |
value_str_list | array | Conditional | String array (for Categorical labels) |
Value Field Mapping
| Label Type | Field | Example |
|---|---|---|
| Text | value | "good" |
| Numeric | value_float | 4.2 |
| Star | value_float | 4.0 |
| Thumbs | value_bool | true |
| Categorical | value_str_list | ["option1"] |
Note Object
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Note content |
annotator_id | UUID | Yes | The annotator’s user ID |
Response
| Field | Type | Description |
|---|---|---|
message | string | Summary message |
annotations_created | integer | New annotations created |
annotations_updated | integer | Existing annotations updated |
notes_created | integer | Notes created |
succeeded_count | integer | Records processed successfully |
errors_count | integer | Records that failed |
errors | array | Error details for failed records |
Code Examples
import requests
resp = requests.post(
"https://api.futureagi.com/tracer/bulk-annotation/",
headers={"X-Api-Key": "YOUR_KEY", "X-Secret-Key": "YOUR_SECRET"},
json={
"records": [
{
"observation_span_id": "span-uuid-1",
"annotations": [
{"annotation_label_id": "label-uuid", "annotator_id": "user-uuid", "value": "good"},
{"annotation_label_id": "star-label-uuid", "annotator_id": "user-uuid", "value_float": 4.0}
],
"notes": [{"text": "Accurate output.", "annotator_id": "user-uuid"}]
},
{
"observation_span_id": "span-uuid-2",
"annotations": [
{"annotation_label_id": "thumbs-label-uuid", "annotator_id": "user-uuid", "value_bool": True}
]
}
]
}
)
print(resp.json())import axios from 'axios';
const resp = await axios.post(
'https://api.futureagi.com/tracer/bulk-annotation/',
{
records: [
{
observationSpanId: 'span-uuid-1',
annotations: [
{ annotationLabelId: 'label-uuid', annotatorId: 'user-uuid', value: 'good' },
{ annotationLabelId: 'star-label-uuid', annotatorId: 'user-uuid', valueFloat: 4.0 }
],
notes: [{ text: 'Accurate output.', annotatorId: 'user-uuid' }]
},
{
observationSpanId: 'span-uuid-2',
annotations: [
{ annotationLabelId: 'thumbs-label-uuid', annotatorId: 'user-uuid', valueBool: true }
]
}
]
},
{ headers: { 'X-Api-Key': 'YOUR_KEY', 'X-Secret-Key': 'YOUR_SECRET' } }
);
console.log(resp.data);curl -X POST "https://api.futureagi.com/tracer/bulk-annotation/" \
-H "X-Api-Key: YOUR_KEY" \
-H "X-Secret-Key: YOUR_SECRET" \
-H "Content-Type: application/json" \
-d '{
"records": [
{
"observation_span_id": "span-uuid-1",
"annotations": [
{"annotation_label_id": "label-uuid", "annotator_id": "user-uuid", "value": "good"},
{"annotation_label_id": "star-label-uuid", "annotator_id": "user-uuid", "value_float": 4.0}
],
"notes": [{"text": "Accurate output.", "annotator_id": "user-uuid"}]
}
]
}' Was this page helpful?