API Reference
Annotations
Human ratings attached to a trace or an evaluation result.
GET
/api/annotationsList all annotations, newest first.
{
"annotations": [
{
"id": "ann_001",
"targetType": "evaluation_result",
"targetId": "res_2004",
"rating": "bad",
"note": "Output missed a key detail present in the expected answer — needs prompt tweak.",
"annotator": "jordan@acme.com",
"createdAt": "2026-07-14T22:22:00.000Z"
}
]
}POST
/api/annotationsCreate an annotation on a trace or an evaluation result.
| Body field | Type | Required |
|---|---|---|
| targetType | "trace" | "evaluation_result" | yes |
| targetId | string | yes |
| rating | "good" | "bad" | yes |
| note | string | no |
| annotator | string | no — defaults to "you@devx-ai.local" |
curl -X POST https://preview.devx-ai.xyz/api/annotations \
-H "Content-Type: application/json" \
-d '{
"targetType": "trace",
"targetId": "trace_011",
"rating": "bad",
"note": "Response was too verbose for a support reply."
}'Returns 201 with { annotation }. 400 if targetType, targetId, or rating is missing/invalid.
Data model
| Field | Type | Notes |
|---|---|---|
| targetType | AnnotationTargetType | Which kind of resource this rates |
| targetId | string | The trace or evaluation-result id — not validated against real records |
| rating | AnnotationRating | good / bad, rendered as thumbs up/down |