Retrieve the trace for a message

Resolve and retrieve the trace produced for a specific message, identified by the message ID returned from the thread messages endpoint. Returns the same shape as retrieveAgentTrace. Returns 404 when no trace can be resolved for the message — because it predates the trace-retention window, because the message belongs to a different agent than the one in the path, or because the message was not produced by an agent run at all. A non-UUID message ID is rejected at validation with a 400.

Rate limit: shares the trace-list limiter — 30 requests per minute per organization. Responses carry RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset headers, plus Retry-After on a 429.

get/v1/agents/{id}/messages/{messageId}/trace

Request

  • Base URL
    https://api.runbear.io
  • Auth
    HTTP bearer

Path parameters

idstring uuid required

The ID of the agent

Example:0fade940-133f-49e6-bf4b-8f662186479b
messageIdstring uuid required

The ID of the message (as returned by the thread messages endpoint) to resolve a trace for

Example:019ecd2c-488f-7bc2-a51c-73bd28549b96

Response

Default Response

traceIdstring required

Trace ID

timestampstring required

ISO 8601 timestamp

threadIdstring nullable required

Thread ID (UUID)

latencynumber nullable required

Latency in seconds

metadataobject required

Trace metadata (sensitive fields excluded)

modelstring nullable required

LLM model used in the last generation

inputunknown
outputunknown
userContextobject

User context metadata passed via SDK

Example response

{
  "sessionStartHook": {
    "fetchedAt": "2026-07-22T19:03:58.412Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.