Skip to main content
Base URL: https://api.zeroeval.com All requests require a Bearer token:
Authorization: Bearer YOUR_ZEROEVAL_API_KEY

Completion Feedback

POST /v1/prompts/{prompt_slug}/completions/{completion_id}/feedback
Submit structured feedback for a specific LLM completion. This feedback powers prompt optimization. Request body:
FieldTypeRequiredDescription
thumbs_upboolYesPositive or negative feedback
reasonstringNoExplanation of the feedback
expected_outputstringNoWhat the output should have been
metadataobjectNoAdditional metadata
judge_idstringNoJudge automation ID
expected_scorefloatNoExpected score (for scored judges)
score_directionstringNo"too_high" or "too_low"
criteria_feedbackobjectNoPer-criterion feedback
curl -X POST https://api.zeroeval.com/v1/prompts/support-bot/completions/550e8400-.../feedback \
  -H "Authorization: Bearer $ZEROEVAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "thumbs_up": false,
    "reason": "Response was too vague",
    "expected_output": "Should provide specific steps"
  }'
Response: 200
{
  "id": "fb123e45-...",
  "completion_id": "550e8400-...",
  "prompt_id": "a1b2c3d4-...",
  "thumbs_up": false,
  "reason": "Response was too vague",
  "expected_output": "Should provide specific steps",
  "created_at": "2025-01-15T10:30:00Z"
}
If feedback already exists for the same completion from the same user, it will be updated with the new values.

Unified Entity Feedback

GET /projects/{project_id}/feedback/{entity_type}/{entity_id}
Retrieve all feedback — human reviews and judge evaluations — for a span, trace, or session in a single response.
Path ParameterDescription
project_idUUID of the project
entity_typespan, trace, or session
entity_idUUID of the entity
Response: 200
{
  "entity_type": "span",
  "entity_id": "550e8400-...",
  "summary": {
    "total": 3,
    "human_feedback_count": 1,
    "judge_evaluation_count": 2
  },
  "items": [
    {
      "kind": "human_feedback",
      "id": "fb123e45-...",
      "span_id": "550e8400-...",
      "thumbs_up": true,
      "reason": "Clear and helpful",
      "created_at": "2025-01-15T10:30:00Z",
      "created_by": {
        "id": "user-123",
        "email": "[email protected]",
        "name": "Alice"
      },
      "source_type": "human"
    },
    {
      "kind": "judge_evaluation",
      "id": "je456f78-...",
      "span_id": "550e8400-...",
      "automation_id": "judge-abc-...",
      "judge_name": "Helpfulness",
      "evaluation_result": true,
      "evaluation_reason": "Response directly answers the question with clear steps.",
      "confidence_score": 0.92,
      "model_used": "gemini-3-flash-preview",
      "evaluation_duration_ms": 1200,
      "score": 8.5,
      "evaluation_type": "scored",
      "score_min": 0,
      "score_max": 10,
      "pass_threshold": 7.0,
      "criteria_scores": {
        "clarity": { "score": 9, "reason": "Well-structured response" },
        "accuracy": { "score": 8, "reason": "Correct information provided" }
      },
      "created_at": "2025-01-15T10:31:00Z"
    }
  ]
}

Response fields

summary — aggregate counts for fast display:
FieldTypeDescription
totalintTotal feedback items
human_feedback_countintNumber of human review items
judge_evaluation_countintNumber of judge evaluation items
items[] — each item has a kind field (human_feedback or judge_evaluation) that determines which fields are present:
Field (human_feedback)TypeDescription
thumbs_upboolPositive or negative
reasonstringReviewer’s explanation
expected_outputstringCorrected output (if provided)
created_byobjectUser who submitted the feedback
source_typestring"human" or "judge"
Field (judge_evaluation)TypeDescription
automation_idstringJudge automation UUID
judge_namestringDisplay name of the judge
evaluation_resultboolWhether the output passed
evaluation_reasonstringJudge’s reasoning
confidence_scorefloatJudge confidence (0-1)
model_usedstringModel used for the evaluation
scorefloatScore value (scored evaluations only)
evaluation_typestring"binary" or "scored"
score_min / score_maxfloatScore range (scored evaluations only)
pass_thresholdfloatThreshold for pass/fail
criteria_scoresobjectPer-criterion scores and reasons
For traces and sessions, feedback is aggregated from all descendant spans.