---
title: "Get Activity Trace"
method: GET
path: "/api/ai-agents/{agent_id}/activity/{activity_id}/trace"
tags: ["ai-agents", "ai-agents"]
---

# Get Activity Trace

`GET /api/ai-agents/{agent_id}/activity/{activity_id}/trace`

## Request

- Base URL: `https://api.dialogbrain.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.dialogbrain.com/api/ai-agents/{agent_id}/activity/{activity_id}/trace`
- Auth: none declared

Return the full ClickHouse execution timeline for an activity row.

Mirrors /admin/traces/{trace_id} but tenant-scoped: the activity row's
agent_id must belong to the caller's workspace. Returns the unchanged
shared TraceDetailResponse.

Voice handover rows (execution_mode='active_session_handover') don't
carry a trace_id in their `details` — the voice bot owns the actual
trace in its own process. We resolve those by looking up the closest
voice trace in ClickHouse by (thread_id, agent_id, time window).

Status discriminators:
  410 trace_not_recorded — pre-deploy row or non-traced activity_type
  410 trace_expired      — ClickHouse retention evicted the trace row
  410 voice_trace_not_found — handover row but no matching voice trace

## Path parameters

- `agent_id` integer, required
- `activity_id` integer, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway.md) · [All operations](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/dialogbrain/apis/dialogbrain-v2-api-gateway/revisions/d84e7dc9977d?raw)
