---
title: "Submit Test Case Result"
method: POST
path: "/v1/test-runs/evaluate/{testCaseId}"
tags: ["Evaluation"]
---

# Submit Test Case Result

`POST /v1/test-runs/evaluate/{testCaseId}`

## Request

- Base URL: `https://api.confident-ai.com`
- URL: `https://api.confident-ai.com/v1/test-runs/evaluate/{testCaseId}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/docs/v1/test-runs/evaluate/:testCaseId/post.ts> (a function with typed inputs; its response is checked against the schema)

Submit the result for a single test case in a long-running agent evaluation. Confident AI automatically evaluates the test case and finalizes the test run once every result has been received.

Long-running mode is available for single-turn AI connection evaluations only.

## Request body

- SubmitTestCaseResultRequest
  - `actualOutput` string: The actual output produced by your agent.
  - `retrievalContext` string[]: The retrieval context your agent used, if any.
  - `toolsCalled` ToolCallData[]: The tools your agent called while producing the output.
    - `name` string, required: This is the name of the tool.
    - `description` string, required: This is the description of the tool.
    - `inputParameters` object: This is the input parameters that are passed to the tool.
    - `output` string: This is the output of the tool.
    - `reasoning` string: This is the reasoning your LLM provided for the tool call.
  - `expectedTools` ToolCallData[]: The tools you expected to be called for this test case.
    - `name` string, required: This is the name of the tool.
    - `description` string, required: This is the description of the tool.
    - `inputParameters` object: This is the input parameters that are passed to the tool.
    - `output` string: This is the output of the tool.
    - `reasoning` string: This is the reasoning your LLM provided for the tool call.
  - `metadata` object: Optional additional metadata to attach to the test case.

## Response `200`

The result was accepted for evaluation.

- SubmitTestCaseResultResponse
  - `success` boolean, required: A boolean indicating the success or failure of the API call.
  - `data` object, required: The recorded test case id and its status.
    - `testCaseId` string, required: The test case id the result was recorded for.
    - `status` 'accepted' | 'already_received', required: `accepted` when queued for evaluation; `already_received` on an idempotent retry.

## Other responses

- `400`: Invalid request body, the test run has no metric collection, or the test run is conversational (long-running mode is single-turn only).
- `404`: No test run was found for the given testCaseId in this project.
- `409`: The test run is no longer accepting results (already finalized).
- `410`: Unknown or expired testCaseId — the result window for this test case has closed.

## Changes

> 54 revisions in range; 3 not diffed.

- **2026-07-13** `9ddd2480139e`: 1 info
  - endpoint added
- **2026-07-10** `9ddd2480139e`: 1 info
  - endpoint added
- **2026-07-09** `92973df248e8`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/changes/v1/test-runs/evaluate/:testCaseId/post.md)

---

[API](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api.md) - [All operations](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/llms.txt) - [OpenAPI document](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/revisions/95cdde71b65e?raw)
