API ReferenceAgent LogsagentLogs
Inspect an agent turn
GET /api/workspaces/{workspaceId}/agent/logs/turns/{turnId}
Endpoint
GET
/api/workspaces/{workspaceId}/agent/logs/turns/{turnId}Read events for one turn when reconstructing the agent’s response. This is a repeatable read. See agentLogs_getAgentCallLog. Required personal key scopes: workspace:view, agent:logs:read.
Authorization
Bearer token · workspace:view · agent:logs:read
Parameters
workspaceIdpath · uuid · required- Workspace UUID returned by list workspaces.
turnIdpath · string · required- Agent turn ID associated with the log event.
sessionIdquery · string · required- Identifier of the agent session.
cursorquery · string · optional- Opaque cursor returned by the preceding page.
API-Versionheader · string · optional- Optional platform API major version. Omit to use the current default. Allowed values: 1
Responses
200 Success
application/json schema
{
"type": "object",
"properties": {
"events": {
"type": "array",
"items": {
"type": "object",
"properties": {
"eventId": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Identifier of the event."
},
"provider": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Provider associated with the connection, event or channel."
},
"chatId": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Chat identifier assigned by the channel provider."
},
"chatType": {
"type": "string",
"enum": [
"group",
"private",
"channel"
],
"description": "Provider classification of the conversation."
},
"threadId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Thread identifier within the chat."
},
"participantIds": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 512
},
"maxItems": 100,
"description": "Provider identifiers of participants in the conversation."
},
"senderId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Identifier of the sender at the channel provider."
},
"senderName": {
"anyOf": [
{
"type": "string",
"maxLength": 100000
},
{
"type": "null"
}
],
"description": "Sender display name supplied by the channel."
},
"senderIsBot": {
"type": "boolean",
"description": "Whether the channel identifies the sender as a bot."
},
"kind": {
"type": "string",
"enum": [
"inbound",
"outbound",
"decision",
"tool_call",
"tool_result"
],
"description": "Discriminator identifying the kind of entry."
},
"messageId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Identifier of the message."
},
"replyToMessageId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Identifier of the reply to message."
},
"sessionId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Identifier of the agent session."
},
"turnId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Agent turn ID associated with the log event."
},
"text": {
"anyOf": [
{
"type": "string",
"maxLength": 100000
},
{
"type": "null"
}
],
"description": "Human-readable content of the message or log entry."
},
"decision": {
"anyOf": [
{
"type": "string",
"enum": [
"reply",
"silent"
]
},
{
"type": "null"
}
],
"description": "Whether the agent chose to reply or stay silent."
},
"reason": {
"anyOf": [
{
"type": "string",
"maxLength": 100000
},
{
"type": "null"
}
],
"description": "Explanation of the reported status or decision."
},
"toolCallId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "ID of a particular invocation of an agent tool."
},
"toolName": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Name of the invoked agent tool."
},
"argsSummary": {
"anyOf": [
{
"type": "string",
"maxLength": 100000
},
{
"type": "null"
}
],
"description": "Short rendering of the arguments passed to the tool."
},
"status": {
"anyOf": [
{
"type": "string",
"enum": [
"requested",
"completed",
"failed",
"rejected",
"cancelled",
"unknown",
"sent",
"uncertain"
]
},
{
"type": "null"
}
],
"description": "Current lifecycle or execution status."
},
"operationId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Identifier of the operation."
},
"requestedBy": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Identifier of this resource."
},
"kind": {
"type": "string",
"enum": [
"member",
"service"
],
"description": "Discriminator identifying the kind of entry."
},
"name": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"allOf": [
{
"description": "Name identifying this item within its parent resource."
}
]
},
"via": {
"type": "string",
"enum": [
"oauth",
"hq",
"service"
],
"description": "Mechanism through which the operation or event occurred."
},
"clientId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Identifier of the client."
},
"clientName": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 512
},
{
"type": "null"
}
],
"description": "Display name of the client application."
},
"attribution": {
"type": "string",
"maxLength": 2000,
"description": "Empty only for a member's own reply, sent unsigned; the archive refuses it on any other."
}
},
"required": [
"id",
"kind",
"name",
"via",
"clientId",
"clientName",
"attribution"
],
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "Identity or component that requested the operation."
},
"url": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 2000
},
{
"type": "null"
}
],
"description": "Address at which the resource can be accessed."
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Identifier of this resource."
},
"kind": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Discriminator identifying the kind of entry."
},
"filename": {
"type": "string",
"maxLength": 100000,
"description": "File name supplied for this attachment."
},
"contentType": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Media type describing the content."
},
"size": {
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"enum": [
"Infinity",
"-Infinity",
"NaN"
]
}
],
"allOf": [
{
"description": "Size of the resource in the units used by its enclosing object."
}
]
},
"uniqueId": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Unique identifier assigned to the attachment."
}
},
"required": [
"id",
"kind"
],
"additionalProperties": false
},
"maxItems": 100,
"description": "Files associated with the message."
},
"at": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"allOf": [
{
"description": "Time of the recorded event."
}
]
},
"sequence": {
"type": "string",
"description": "Sequence number used to order entries."
},
"storedAt": {
"type": "string",
"description": "Time when the item was stored."
},
"argsText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Retained text of the tool arguments."
},
"resultText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Retained textual result of the tool call."
},
"errorText": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Text describing the tool or runtime failure."
},
"contentExpired": {
"type": "boolean",
"description": "Whether retention has removed the original content."
},
"chatTitle": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The chat's title in the agent's chat registry, matched by provider and chat ID; null when the registry has no such chat, absent when the registry could not be read."
},
"trace": {
"type": "string",
"enum": [
"available",
"unavailable",
"expired"
],
"description": "Whether the agent's runs keep the trace of the event's turn, for 30 days: in a list, `available` within them and `expired` past them; in a turn's detail, `available` when it was read, `unavailable` when it could not be (see `traceError`). Absent on events without a turn and on logs read from the chat archive in the platform."
},
"traceError": {
"type": "string",
"minLength": 1,
"maxLength": 512,
"description": "Why the turn's trace is `unavailable`: trace_not_deployed, trace_not_configured, trace_refused, trace_not_found, trace_rate_limited, trace_unreadable, trace_unavailable or trace_turn_not_found."
}
},
"required": [
"eventId",
"provider",
"chatId",
"chatType",
"threadId",
"participantIds",
"senderId",
"senderName",
"senderIsBot",
"kind",
"messageId",
"replyToMessageId",
"sessionId",
"turnId",
"text",
"decision",
"reason",
"toolCallId",
"toolName",
"argsSummary",
"status",
"attachments",
"at",
"sequence",
"storedAt",
"argsText",
"resultText",
"errorText",
"contentExpired"
],
"additionalProperties": false
},
"description": "Agent events in this page, including retained tool call details."
},
"nextCursor": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Opaque continuation cursor for the next page."
},
"turn": {
"type": "object",
"properties": {
"status": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The turn status reported by its trace, or null when omitted."
},
"startedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "When the turn started, as its trace records it."
},
"completedAt": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "When the turn ended, as its trace records it."
},
"durationMs": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"description": "From the turn's start to its end, when the trace has both."
},
"usage": {
"anyOf": [
{
"type": "object",
"properties": {
"inputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"description": "Input tokens neither read from nor written to the prompt cache."
},
"outputTokens": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"description": "Output tokens the model wrote."
},
"cacheReadTokens": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"description": "Input tokens read from the prompt cache."
},
"cacheWriteTokens": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"description": "Input tokens written to the prompt cache."
},
"totalTokens": {
"anyOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "null"
}
],
"description": "All tokens of the turn, as the trace sums them."
}
},
"required": [
"inputTokens",
"outputTokens",
"cacheReadTokens",
"cacheWriteTokens",
"totalTokens"
],
"additionalProperties": false
},
{
"type": "null"
}
],
"description": "The model tokens the turn spent, across its model calls."
},
"costUsd": {
"anyOf": [
{
"anyOf": [
{
"type": "number"
},
{
"type": "string",
"enum": [
"Infinity",
"-Infinity",
"NaN"
]
}
]
},
{
"type": "null"
}
],
"description": "The turn's model cost in US dollars, when the trace reports it."
}
},
"required": [
"status",
"startedAt",
"completedAt",
"durationMs",
"usage",
"costUsd"
],
"additionalProperties": false,
"description": "The turn's figures, on every page of a turn whose trace was read; absent when the trace is unavailable or expired, or the agent's logs are read from the chat archive in the platform."
}
},
"required": [
"events",
"nextCursor"
],
"additionalProperties": false
}Full schema and referenced types ↗Example
{
"events": [],
"nextCursor": null
}Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
- Deprecation
- Present when the operation is deprecated. RFC 9745 date in seconds since the Unix epoch.
- Sunset
- Present when retirement is scheduled. HTTP date of planned removal, per RFC 8594.
400 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
401 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
403 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
404 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
406 Unsupported platform API version
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
409 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
429 Request limit reached
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- Retry-After
- Seconds to wait before retrying the request.
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
500 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).
503 Error
application/json schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Machine-readable error code or diagnostic reported by the operation."
},
"detail": {
"type": "string",
"description": "Human-readable explanation of the failure."
},
"requestId": {
"type": "string",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
"format": "uuid",
"description": "Correlation ID for tracing the request with support."
},
"retryable": {
"type": "boolean",
"description": "Whether retrying the same failed request may succeed."
}
},
"required": [
"error",
"detail",
"requestId",
"retryable"
],
"additionalProperties": true
}Full schema and referenced types ↗Response headers
- API-Version
- Supported platform API major version.
- RateLimit
- Remaining quota (r) and seconds until reset (t), when admission is available.
- RateLimit-Policy
- Request quota (q) and window in seconds (w).