# Get a test invocation

Return one invocation summary and complete result groups, or a lightweight summary when summary_only is true. Individual runs remain paginated.

## Endpoint

`GET /api/v1/workspaces/{workspace_id}/test-invocations/{invocation_id}`

## Authentication

| Class | Authentication | Minimum role | API key |
| --- | --- | --- | --- |
| customer-api | Bearer API key or dashboard session cookie; dashboard mutations also require X-CX-Request: 1. | member | Allowed |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `workspace_id` | path | `string` | Yes | — |
| `invocation_id` | path | `string` | Yes | — |
| `summary_only` | query | `boolean` | No | — |

## Request body

This operation has no request body.

## Example

```bash
curl --request GET 'https://operade.ai/api/v1/workspaces/ws_demo/test-invocations/invo_demo' \
  --header 'Authorization: Bearer YOUR_API_KEY'
```

## Responses

| Status | Description | Content |
| --- | --- | --- |
| 4XX | Handled client error | application/json: `ErrorResponse` |
| 200 | Successful Response | application/json: `object` |

### 4XX application/json response schema

| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `$` | `object` | ErrorResponse | — | No | Yes | — | — |
| `error` | `object` | ErrorItem | — | No | Yes | — | — |
| `error.code` | `string` | — | — | No | Yes | — | — |
| `error.details` | `object` | — | — | No | No | — | — |
| `error.message` | `string` | — | — | No | Yes | — | — |

### 200 application/json response schema

| Field path | Type | Reference | Format | Nullable | Required | Enum | Description |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `$` | `object` | InvocationSummary or InvocationDetail | — | No | Yes | — | — |
| `agent_id` | `string` | — | — | No | Yes | — | — |
| `branch_id` | `string` | — | — | No | Yes | — | — |
| `bucketing_status` | `string` | — | — | No | Yes | "not_applicable", "pending", "completed", "failed" | — |
| `completed_at` | `string or null` | — | date-time | Yes | Yes | — | — |
| `cost_usd` | `number` | — | — | No | Yes | — | — |
| `counts` | `object` | InvocationCounts | — | No | Yes | — | — |
| `counts.failed` | `integer` | — | — | No | Yes | — | — |
| `counts.interrupted` | `integer` | — | — | No | Yes | — | — |
| `counts.passed` | `integer` | — | — | No | Yes | — | — |
| `counts.pending` | `integer` | — | — | No | Yes | — | — |
| `counts.running` | `integer` | — | — | No | Yes | — | — |
| `created_at` | `string` | — | date-time | No | Yes | — | — |
| `created_by` | `string` | — | — | No | Yes | — | — |
| `id` | `string` | — | — | No | Yes | — | — |
| `input_tokens` | `integer` | — | — | No | Yes | — | — |
| `output_tokens` | `integer` | — | — | No | Yes | — | — |
| `pass_rate` | `number or null` | — | — | Yes | Yes | — | — |
| `repeat_count` | `integer` | — | — | No | Yes | — | — |
| `status` | `string` | — | — | No | Yes | "pending", "running", "completed" | — |
| `target` | `string` | — | — | No | Yes | "draft", "live" | — |
| `items` | `array<InvocationItem>` | — | — | No | Yes | — | — |
| `items[]` | `object` | InvocationItem | — | No | Yes | — | — |
| `items[].display_snapshot` | `object` | InvocationDisplaySnapshot | — | No | Yes | — | — |
| `items[].display_snapshot.folder_path` | `array<string>` | — | — | No | Yes | — | — |
| `items[].display_snapshot.folder_path[]` | `string` | — | — | No | Yes | — | — |
| `items[].display_snapshot.name` | `string` | — | — | No | Yes | — | — |
| `items[].display_snapshot.type` | `string` | — | — | No | Yes | "simulation", "llm", "tool" | — |
| `items[].id` | `string` | — | — | No | Yes | — | — |
| `items[].ordinal` | `integer` | — | — | No | Yes | — | — |
| `items[].root_folder_id` | `string or null` | — | — | Yes | Yes | — | — |
| `items[].root_folder_name` | `string or null` | — | — | Yes | Yes | — | — |
| `items[].test_id` | `string` | — | — | No | Yes | — | — |
| `items[].test_revision_id` | `string` | — | — | No | Yes | — | — |
| `items[].workflow_node_id` | `string or null` | — | — | Yes | Yes | — | — |
| `result_groups` | `array<ResultGroup>` | — | — | No | Yes | — | — |
| `result_groups[]` | `object` | ResultGroup | — | No | Yes | — | — |
| `result_groups[].buckets` | `array<FailureBucket>` | — | — | No | Yes | — | — |
| `result_groups[].buckets[]` | `object` | FailureBucket | — | No | Yes | — | — |
| `result_groups[].buckets[].reason` | `string` | — | — | No | Yes | — | — |
| `result_groups[].buckets[].status` | `string` | — | — | No | Yes | "passed", "failed", "interrupted" | — |
| `result_groups[].buckets[].test_run_ids` | `array<string>` | — | — | No | Yes | — | — |
| `result_groups[].buckets[].test_run_ids[]` | `string` | — | — | No | Yes | — | — |
| `result_groups[].buckets[].title` | `string` | — | — | No | Yes | — | — |
| `result_groups[].test_id` | `string` | — | — | No | Yes | — | — |
| `result_groups[].test_name` | `string` | — | — | No | Yes | — | — |
| `result_groups[].workflow_node_id` | `string or null` | — | — | Yes | No | — | — |

### Response example

```json
{
  "id": "string",
  "agent_id": "string",
  "created_by": "string",
  "target": "draft",
  "repeat_count": 0,
  "branch_id": "string",
  "status": "pending",
  "bucketing_status": "not_applicable",
  "created_at": "2026-01-01T00:00:00Z",
  "completed_at": "2026-01-01T00:00:00Z",
  "counts": {
    "pending": 0,
    "running": 0,
    "passed": 0,
    "failed": 0,
    "interrupted": 0
  },
  "pass_rate": 0,
  "input_tokens": 0,
  "output_tokens": 0,
  "cost_usd": 0
}
```

## Errors

Reviewed common and route-declared errors are summarized here; the list is not exhaustive. Start with the [distributed error index](/docs/reference/api/errors) to find each code's canonical domain page.

| Status | Code | Description |
| --- | --- | --- |
| 401 | `unauthenticated` | Authentication is missing, invalid, or revoked. |
| 403 | `forbidden` | The authenticated caller does not have access to this operation. |
| 404 | `not_found` | The requested workspace resource was not found. |
| 422 | `validation_failed` | The request did not pass field or business validation. |

## Related operations

- [Run agent tests](/docs/api-reference/test-invocations/create-test-invocation) — `POST /api/v1/workspaces/{workspace_id}/agents/{agent_id}/test-invocations`
- [Get a test invocation run](/docs/api-reference/test-invocations/get-test-invocation-run) — `GET /api/v1/workspaces/{workspace_id}/test-invocations/{invocation_id}/runs/{run_id}`
- [List test invocation runs](/docs/api-reference/test-invocations/list-test-invocation-runs) — `GET /api/v1/workspaces/{workspace_id}/test-invocations/{invocation_id}/runs`
