---
title: "Get Trace Analysis Context"
method: GET
path: "/v2/trace/{trace_id}/analysis-context"
tags: ["traces"]
---

# Get Trace Analysis Context

`GET /v2/trace/{trace_id}/analysis-context`

Aggregate context for analysis environments (QA agents).

## Path parameters

- `trace_id` string, uuid, required

## Query parameters

- `include_spans` boolean
- `include_env_logs` boolean
- `include_worker_logs` boolean

## Response `200`

Successful Response

- TraceAnalysisContextResponse — Aggregate read for analysis envs; spans carry presigned artifact URLs.
  - `trace_id` string, uuid, required
  - `job_id` string, uuid, nullable
  - `task_id` string, uuid, nullable
  - `task_version_id` string, uuid, nullable
  - `task_external_id` string, nullable
  - `task_name` string, nullable
  - `status` string, required
  - `reward` number, nullable
  - `error` string, nullable
  - `prompt` string, nullable
  - `scenario_name` string, nullable
  - `scenario_args` object
  - `scenario_code` string, nullable
  - `registry_id` string, uuid, nullable
  - `evaluation_result` object, nullable
  - `metadata` object
  - `spans` object[], nullable
  - `spans_count` integer
  - `failed_spans` FailedSpanInfo[]
    - `seq` integer, required
    - `error` string, nullable
  - `env_logs` EnvLogEntry[], nullable
    - `stream` string, required
    - `log` string, required
    - `time` string, nullable
  - `worker_logs` string, nullable

## Other responses

- `400` — Invalid or malformed request
- `401` — Missing or invalid credentials
- `403` — Caller may not access this resource
- `404` — Referenced entity does not exist
- `409` — Resource already exists
- `422` — Validation Error

---

[API](https://skmtc.dev/hud/apis/hud-platform.md) · [All operations](https://skmtc.dev/hud/apis/hud-platform/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hud/hud-platform/revisions/58558fc733d9/schema)
