Traces
List, inspect and annotate execution traces — comments, bookmarks and model-call replay. The Trace Explorer's API.
Every intent call, agent run and workflow run records an execution trace. This is the JWT-authenticated surface the dashboard's Trace Explorer uses, for your own admin tooling.
From your backend, with an API key
Reading traces, run traces and statistics is also available with a tenant API key at /v1/traces, served by the same handlers. See the Traces API reference. Comments, bookmarks and replay belong to a signed-in user, so they are only here.
GET /dashboard/traces # list (same filters as /v1/traces)
GET /dashboard/traces/stats # statistics over every matching trace
GET /dashboard/traces/intent-stats # daily request counts per custom intent
GET /dashboard/traces/:messageId # the full trace of one request
GET /dashboard/traces/runs/:kind/:runId # an agent or workflow run's trace
GET /dashboard/traces/annotations/:kind/:id # comments, and whether you bookmarked it
POST /dashboard/traces/annotations/:kind/:id/comments # add a comment
PUT /dashboard/traces/annotations/:kind/:id/bookmark # bookmark or un-bookmark
DELETE /dashboard/traces/comments/:commentId # delete a comment
POST /dashboard/traces/replay # re-run a model call (supervisor or higher)Reading traces
The list, single-trace, run-trace and statistics endpoints take the same parameters and return the same shapes as their /v1/traces counterparts, documented in the Traces API reference. Three differences when called with a dashboard login:
- Role decides what you see. The text of requests and responses, retrieved snippets and agent step input and output are shown to the
supervisorrole and above. Lower roles see the trace with that content withheld, andcontentAccesssaysrestricted_by_role. A workspace set to minimal capture stores no content for anyone (not_stored). Workflow run traces are visible to admins. - Bookmarks are per user.
bookmarkedon a row reflects your own bookmarks, andbookmarked=truefilters the list to them. Through the API-key surface it is always false. - Retention. Traces are kept for the period your plan includes.
Comments and bookmarks
:kind is request, agent_run or workflow_run, and :id is the trace id.
POST https://api.liyaengine.ai/dashboard/traces/annotations/request/msg_xyz/comments
Authorization: Bearer <jwt>
Content-Type: application/json
{ "body": "This answer cites the old refund window.", "observationId": "obs_3" }body is required and limited to 4,000 characters. observationId is optional and attaches the comment to one step of the trace. The response is 201 with the trace's comments and your bookmark state.
PUT https://api.liyaengine.ai/dashboard/traces/annotations/request/msg_xyz/bookmark
{ "bookmarked": true }Deleting a comment is limited to its author or an admin. Adding and deleting comments are recorded in the audit log as trace.comment_add and trace.comment_delete.
Replay a model call
Replay re-runs a model call from a trace, optionally on a different model, to see how it would have answered. It is a real, metered model call, so it needs the supervisor role, counts against your plan quota, and goes through your model routing, including your own provider keys. Guardrails run on it like any call.
POST https://api.liyaengine.ai/dashboard/traces/replay
Authorization: Bearer <jwt>
Content-Type: application/json
{
"messages": [
{ "role": "system", "content": "You are a support assistant." },
{ "role": "user", "content": "Where is my refund?" }
],
"model": "claude-sonnet-5",
"temperature": 0.2,
"max_tokens": 600,
"source": { "kind": "request", "id": "msg_xyz", "observationId": "obs_3" }
}| Field | Description |
|---|---|
messages | Required. A non-empty list of { role, content } (up to 100 messages and 200,000 characters), with at least one user message. A tool result is sent as a labelled user message, and the response says so in notes. |
model | Optional. Defaults to your routing for the call. |
temperature, top_p, max_tokens | Optional. 0 to 2, 0 to 1, and 1 to 32,000. |
response_format | Set to json_object for JSON mode. |
source | Optional. Which trace and step this replays, recorded in the audit log. |
The response returns the model's output, the model used, token usage (input, output, total and cached), costUsd, latencyMs, servedBy (the platform or your own key), finishReason and any notes. A guardrail block returns the error with blockedBy. Every replay is recorded in the audit log as trace.replay, with its outcome and cost.
Errors
| Code | HTTP | Meaning |
|---|---|---|
TRACE_NOT_FOUND | 404 | No such trace, run or kind in your workspace. |
FORBIDDEN | 403 | A workflow run was requested without the admin role, or a comment was deleted by someone who is neither its author nor an admin. |
COMMENT_NOT_FOUND | 404 | No such comment. |
INVALID_COMMENT, INVALID_BOOKMARK, INVALID_REPLAY | 400 | The request body failed validation. The message says what to fix. |