API Reference

Annotations

Human ratings attached to a trace or an evaluation result.

GET/api/annotations

List 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/annotations

Create an annotation on a trace or an evaluation result.

Body fieldTypeRequired
targetType"trace" | "evaluation_result"yes
targetIdstringyes
rating"good" | "bad"yes
notestringno
annotatorstringno — 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

FieldTypeNotes
targetTypeAnnotationTargetTypeWhich kind of resource this rates
targetIdstringThe trace or evaluation-result id — not validated against real records
ratingAnnotationRatinggood / bad, rendered as thumbs up/down