Retrieve remote session messages
GET /v1/compliance/apps/sessions/remote/\{claude_remote_session_id\}/messages
Retrieve one remote session's transcript: user prompts, assistant responses, and tool calls and results. Thinking blocks and images are not included.
Messages are returned oldest first by default; pass order=desc to reverse. Pagination uses the same page/next_page scheme as the list endpoint, with at most limit messages per page (default 100, maximum 1000); keep paginating until next_page is null. tool_use_input_max_bytes and tool_result_max_bytes cap how many bytes of each tool-use input and each tool-result text item are returned; a block shortened by either cap carries truncated: true.
The response embeds the session's metadata under session alongside the paginated data array. On this endpoint session.user.email_address and session.started_by_user are always null; read them from the list endpoint instead.
Returns 404 while the session is still pending, for deleted sessions, and for sessions outside the organizations the key may read. A malformed session identifier returns 400.
Path parameters
claude_remote_session_id: stringThe remote session identifier (
cse_...) to retrieve
Query parameters
limit: optional numberMaximum results (default: 100, max: 1000)
default: 100, maximum: 1000, minimum: 1
order: optional "asc" or "desc"Sort direction.
asc(oldest-first) ordesc.default: asc
"asc""desc"
page: optional stringOpaque pagination token from a previous response's
next_pagefield. Pass this to retrieve the next page of results. Clients should treat this value as an opaque string and not attempt to parse or interpret its contents, as the format may change without notice.tool_result_max_bytes: optional numberTruncate each text item inside a tool result to at most this many bytes (cut on a code-point boundary). Pass
-1to request the server maximum.0is not a valid value.default: 10000, maximum: 2147483647, minimum: -1
tool_use_input_max_bytes: optional numberTruncate each tool-use input to at most this many bytes (cut on a code-point boundary so the result is valid UTF-8). Pass
-1to request the server maximum.0is not a valid value.default: 10000, maximum: 2147483647, minimum: -1
Headers
"anthropic-version": optional stringThe version of the Claude API you want to use.
Read more about versioning and our version history here.
"x-api-key": optional string
Returns
data: array of objectTranscript turns for this page, ordered by transcript position.
created_atis a commit timestamp and may tie or invert under concurrent writes; do not re-sort by it.id: stringUnique identifier for the message, e.g.
csev_abc123content: array of object or object or objectContent blocks within the message
Text objectText content block.
type: "text"default: text
text: stringText content from the user or the assistant
truncated: booleanTrue when
textexceeded the server-defined maximum (approximately 1 MiB) and was shortened.default: false
ToolUse objectTool invocation requested by the assistant.
type: "tool_use"default: tool_use
id: string or nullTool-use ID, e.g. 'toolu_01AbC...'
input: stringArguments passed to the tool, as a JSON-encoded string. May be shortened — see the
truncatedfieldname: stringName of the tool invoked
truncated: booleanTrue when
inputwas shortened. Passtool_use_input_max_bytes=-1to request full content, subject to the server-side maximum.default: false
ToolResult objectResult returned by a tool invocation.
type: "tool_result"default: tool_result
content: array of objectText content returned by the tool. Non-text item types are omitted.
type: "text"default: text
text: stringText returned by the tool
is_error: booleanTrue when the tool reported an error
name: stringName of the tool that produced this result
tool_use_id: string or nullID of the tool_use block this result responds to
truncated: booleanTrue when one or more text items in
contentwere shortened. Passtool_result_max_bytes=-1to request full content, subject to the server-side maximum.default: false
content_unavailable: booleanTrue when the stored content could not be returned — it could not be decrypted, or it exceeded the server's per-event size bound.
contentis empty in that case; this distinguishes 'no content' from 'content withheld'.default: false
created_at: stringWhen the message was recorded (RFC 3339, UTC)
format: date-time
role: "assistant" or "user"Message sender (
userorassistant)"assistant""user"
sent_by_user_id: string or nullIdentifier of the human account that sent this turn on an agent-owned session. Null on user-owned sessions, where every user-role turn was sent by the session's
user.
next_page: string or nullOpaque page token; pass as
pageto retrieve the next page. Null when no rows exist after this page. Treat this value as opaque; do not parse or store it long-term, as the format may change without notice.session: objectSession metadata.
started_by_user,user.email_address, andclaude_project_idare always null on this endpoint; the messages endpoint resolves neither email addresses nor project bindings.id: stringRemote session identifier
agent_id: string or nullIdentifier of the automated agent that owns the session. Null for user-owned sessions. At most one of
userandagent_idis set.claude_project_id: string or nullID of the project the session is bound to. Null when the session has no project binding.
created_at: stringWhen the session was created (RFC 3339, UTC)
format: date-time
organization_uuid: stringUUID of the organization the session belongs to
product_surface: string or nullThe Claude product the session was created from. Currently
cowork_remote, for Cowork sessions started on claude.ai web or mobile. More values will appear as other surfaces launch, so treat any unrecognized value as an unclassified surface rather than an error. Null for sessions created before this field was recorded, for surfaces that do not stamp it, and for unrecognized tag values.started_by_user: object or nullA user associated with a remote session.
id: stringUser identifier
email_address: string or nullUser's email address. Null when the user is no longer a member of an organization the key may read —
idremains set so attribution is preserved. The messages endpoint does not resolve email addresses; this field is always null there.
status: stringSession lifecycle state. One of
active,paused,archived, orfailed— the lifecycle states the owning product surface exposes — pluspending, a brief transient state that resolves before any transcript content exists. The list endpoint includespending; the messages endpoint returns 404 for it. Deleted sessions are not returned on either endpoint. Treat unrecognized values as an unknown state rather than an error.updated_at: stringWhen the session was last modified (RFC 3339, UTC)
format: date-time
user: object or nullA user associated with a remote session.
id: stringUser identifier
email_address: string or nullUser's email address. Null when the user is no longer a member of an organization the key may read —
idremains set so attribution is preserved. The messages endpoint does not resolve email addresses; this field is always null there.
Example
curl https://api.anthropic.com/v1/compliance/apps/sessions/remote/$CLAUDE_REMOTE_SESSION_ID/messages \
-H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"Response (200)
{
"data": [
{
"id": "id",
"content": [
{
"text": "text",
"truncated": true,
"type": "text"
}
],
"content_unavailable": true,
"created_at": "2019-12-27T18:11:19.117Z",
"role": "assistant",
"sent_by_user_id": "sent_by_user_id"
}
],
"next_page": "next_page",
"session": {
"id": "id",
"agent_id": "agent_id",
"claude_project_id": "claude_project_id",
"created_at": "2019-12-27T18:11:19.117Z",
"organization_uuid": "organization_uuid",
"product_surface": "product_surface",
"started_by_user": {
"id": "id",
"email_address": "email_address"
},
"status": "status",
"updated_at": "2019-12-27T18:11:19.117Z",
"user": {
"id": "id",
"email_address": "email_address"
}
}
}