The whole hunk
from line 1, old and new numbered
/
lines
from line 1
1---
2title: Retrieve local session messages
3url: https://platform.claude.com/docs/en/api/compliance/apps/sessions/local/messages/list
4---
5
16# Retrieve local session messages
27
38**GET** `/v1/compliance/apps/sessions/local/{local_session_id}/messages`
from line 57
5257
5358## Headers
5459
60- `"anthropic-version": optional string`
61
62 The version of the Claude API you want to use.
63
64 Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).
65
5566- `"x-api-key": optional string`
5667
5768## Returns
from line 71
6071
6172 Transcript turns for this page, in call order: oldest call first by default, newest call first with `order=desc`. The messages of one call carry the call's timestamp and follow each other in transcript order; a page boundary can fall between them.
6273
74 - `type: "compliance_local_session_message"`
75
76 default: compliance_local_session_message
77
6378 - `id: string`
6479
6580 Message identifier, prefixed `clsm_`. Stable for as long as the message's turn is retained: identifiers of retained turns do not change as older turns age out of the organization's retention period. The `retention_elapsed` placeholder's identifier is distinct from every retained turn's and changes only when further turns age out.
from line 87
7287
7388 Text content block.
7489
90 - `type: "text"`
91
92 default: text
93
7594 - `text: string`
7695
7796 Text content from the user or the assistant
from line 101
82101
83102 default: false
84103
85 - `type: "text"`
86
87 default: text
88
89104 - `ToolUse object`
90105
91106 Tool invocation requested by the assistant.
92107
108 - `type: "tool_use"`
109
110 default: tool_use
111
93112 - `id: string or null`
94113
95114 Tool-use ID, e.g. 'toolu_01AbC...'
from line 127
108127
109128 default: false
110129
111 - `type: "tool_use"`
112
113 default: tool_use
114
115130 - `ToolResult object`
116131
117132 Result returned by a tool invocation.
118133
134 - `type: "tool_result"`
135
136 default: tool_result
137
119138 - `content: array of object`
120139
121140 Text content returned by the tool. Non-text item types are omitted and signalled via `truncated` with an in-band item-count marker.
122141
123 - `text: string`
124
125 Text returned by the tool
126
127142 - `type: "text"`
128143
129144 default: text
130145
146 - `text: string`
147
148 Text returned by the tool
149
131150 - `is_error: boolean`
132151
133152 True when the tool reported an error
from line 165
146165
147166 default: false
148167
149 - `type: "tool_result"`
150
151 default: tool_result
152
153168 - `created_at: string`
154169
155170 When the message was recorded (RFC 3339, UTC)
from line 183
168183
169184 The turn's content cannot be returned; `content` is empty.
170185
171 - `reason: string`
172
173 Why this turn's content cannot be returned, e.g. `not_captured` (the content was not captured for compliance retrieval), `client_aborted` (the client closed the connection or cancelled the request before the response completed, so the response was not captured for this turn; any partial output already streamed to the client is not included; assistant-role turns only), `cmek_key_revoked` (the content is encrypted under the organization's customer-managed key and that key is unavailable), `retention_elapsed` (the content lies past the organization's retention boundary; on the placeholder standing in for every pre-boundary turn), or `oversize` (the message exceeds the server's per-message size bound even after per-block truncation). Callers should tolerate unrecognized values. `not_captured` is not proof that no record was stored: content withheld by the storage layer's fail-closed access policies carries the same reason and is deliberately indistinguishable from content that was never captured.
174
175186 - `type: "content_unavailable"`
176187
177188 default: content_unavailable
178189
190 - `reason: string`
191
192 Why this turn's content cannot be returned, e.g. `not_captured` (the content was not captured for compliance retrieval), `client_aborted` (the client closed the connection or cancelled the request before the response completed, so the response was not captured for this turn; any partial output already streamed to the client is not included; assistant-role turns only), `cmek_key_revoked` (the content is encrypted under the organization's customer-managed key and that key is unavailable), `retention_elapsed` (the content lies past the organization's retention boundary; on the placeholder standing in for every pre-boundary turn), or `oversize` (the message exceeds the server's per-message size bound even after per-block truncation). Callers should tolerate unrecognized values. `not_captured` is not proof that no record was stored: content withheld by the storage layer's fail-closed access policies carries the same reason and is deliberately indistinguishable from content that was never captured.
193
179194 - `ClientAsserted object`
180195
181196 Assistant content the client supplied as conversation history
from line 227
212227
213228 - `"user"`
214229
215 - `type: "compliance_local_session_message"`
216
217 default: compliance_local_session_message
218
219230- `next_page: string or null`
220231
221232 Opaque pagination cursor (prefixed `page_`) for the next page. Null when there is no further page. Treat as an opaque string; the format may change without notice.
from line 235
224235
225236 The local session the messages belong to. `user.email_address` is always null on this endpoint; the messages endpoint does not resolve email addresses.
226237
238 - `type: "compliance_local_session"`
239
240 default: compliance_local_session
241
227242 - `id: string`
228243
229244 Local session identifier, prefixed `clls_`. Unique within the parent organization. Treat as an opaque string; the format may change without notice.
from line 257
242257
243258 The product the session ran in: `cowork` (Cowork in Claude Desktop on the user's machine), `claude_code` (Claude Code), `claude_science` (Claude Science), or one of `office_agents/excel`, `office_agents/powerpoint`, `office_agents/word`, and `office_agents/outlook` (Claude for Microsoft 365, by app; `office_agents` alone when the app is not identified). New values appear as coverage expands; treat unrecognized values as opaque. `null` when the surface was not recorded.
244259
245 - `type: "compliance_local_session"`
260 - `truncated: boolean`
246261
247 default: compliance_local_session
262 True when the session has more inference calls than the service can return for one session (100,000). The messages endpoint then returns only the session's earliest calls, up to that many, and ends before the session does; `updated_at` is a lower bound on the latest call and can differ between the list and retrieve endpoints. False for every session within that bound.
248263
264 default: false
265
249266 - `updated_at: string`
250267
251268 Timestamp of the session's last retained inference call (RFC 3339, UTC). Always at or after `created_at`. When a session's activity spans the child organization's retention boundary, calls older than the boundary are no longer reflected — but because retention removes only the oldest calls, this value (unlike `created_at`) is unaffected until the entire session has aged out. On the list endpoint this value is a lower bound: for a session still active at a page or `created_at.lt` window boundary it can momentarily lag the session's true last activity. Retrieving the session, or its messages, always reflects the exact latest retained call.
from line 322
305322 "created_at": "2025-03-12T18:22:41.123456Z",
306323 "organization_uuid": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
307324 "product_surface": "cowork",
325 "truncated": true,
308326 "type": "compliance_local_session",
309327 "updated_at": "2025-03-12T18:22:41.123456Z",
310328 "user": {