The whole hunk
from line 1, old and new numbered
/
lines
from line 1
1---
2title: Messages
3url: https://platform.claude.com/docs/en/api/compliance/apps/sessions/local/messages
4---
5
16# Messages
27
38## Retrieve local session messages
from line 59
5459
5560### Headers
5661
62- `"anthropic-version": optional string`
63
64 The version of the Claude API you want to use.
65
66 Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).
67
5768- `"x-api-key": optional string`
5869
5970### Returns
from line 73
6273
6374 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.
6475
76 - `type: "compliance_local_session_message"`
77
78 default: compliance_local_session_message
79
6580 - `id: string`
6681
6782 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 89
7489
7590 Text content block.
7691
92 - `type: "text"`
93
94 default: text
95
7796 - `text: string`
7897
7998 Text content from the user or the assistant
from line 103
84103
85104 default: false
86105
87 - `type: "text"`
88
89 default: text
90
91106 - `ToolUse object`
92107
93108 Tool invocation requested by the assistant.
94109
110 - `type: "tool_use"`
111
112 default: tool_use
113
95114 - `id: string or null`
96115
97116 Tool-use ID, e.g. 'toolu_01AbC...'
from line 129
110129
111130 default: false
112131
113 - `type: "tool_use"`
114
115 default: tool_use
116
117132 - `ToolResult object`
118133
119134 Result returned by a tool invocation.
120135
136 - `type: "tool_result"`
137
138 default: tool_result
139
121140 - `content: array of object`
122141
123142 Text content returned by the tool. Non-text item types are omitted and signalled via `truncated` with an in-band item-count marker.
124143
125 - `text: string`
126
127 Text returned by the tool
128
129144 - `type: "text"`
130145
131146 default: text
132147
148 - `text: string`
149
150 Text returned by the tool
151
133152 - `is_error: boolean`
134153
135154 True when the tool reported an error
from line 167
148167
149168 default: false
150169
151 - `type: "tool_result"`
152
153 default: tool_result
154
155170 - `created_at: string`
156171
157172 When the message was recorded (RFC 3339, UTC)
from line 185
170185
171186 The turn's content cannot be returned; `content` is empty.
172187
173 - `reason: string`
174
175 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.
176
177188 - `type: "content_unavailable"`
178189
179190 default: content_unavailable
180191
192 - `reason: string`
193
194 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.
195
181196 - `ClientAsserted object`
182197
183198 Assistant content the client supplied as conversation history
from line 229
214229
215230 - `"user"`
216231
217 - `type: "compliance_local_session_message"`
218
219 default: compliance_local_session_message
220
221232- `next_page: string or null`
222233
223234 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 237
226237
227238 The local session the messages belong to. `user.email_address` is always null on this endpoint; the messages endpoint does not resolve email addresses.
228239
240 - `type: "compliance_local_session"`
241
242 default: compliance_local_session
243
229244 - `id: string`
230245
231246 Local session identifier, prefixed `clls_`. Unique within the parent organization. Treat as an opaque string; the format may change without notice.
from line 259
244259
245260 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.
246261
247 - `type: "compliance_local_session"`
262 - `truncated: boolean`
248263
249 default: compliance_local_session
264 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.
250265
266 default: false
267
251268 - `updated_at: string`
252269
253270 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 324
307324 "created_at": "2025-03-12T18:22:41.123456Z",
308325 "organization_uuid": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
309326 "product_surface": "cowork",
327 "truncated": true,
310328 "type": "compliance_local_session",
311329 "updated_at": "2025-03-12T18:22:41.123456Z",
312330 "user": {
from line 344
326344
327345 A single user or assistant turn in a local session transcript.
328346
347 - `type: "compliance_local_session_message"`
348
349 default: compliance_local_session_message
350
329351 - `id: string`
330352
331353 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 360
338360
339361 Text content block.
340362
363 - `type: "text"`
364
365 default: text
366
341367 - `text: string`
342368
343369 Text content from the user or the assistant
from line 374
348374
349375 default: false
350376
351 - `type: "text"`
352
353 default: text
354
355377 - `ToolUse object`
356378
357379 Tool invocation requested by the assistant.
358380
381 - `type: "tool_use"`
382
383 default: tool_use
384
359385 - `id: string or null`
360386
361387 Tool-use ID, e.g. 'toolu_01AbC...'
from line 400
374400
375401 default: false
376402
377 - `type: "tool_use"`
378
379 default: tool_use
380
381403 - `ToolResult object`
382404
383405 Result returned by a tool invocation.
384406
407 - `type: "tool_result"`
408
409 default: tool_result
410
385411 - `content: array of object`
386412
387413 Text content returned by the tool. Non-text item types are omitted and signalled via `truncated` with an in-band item-count marker.
388414
389 - `text: string`
390
391 Text returned by the tool
392
393415 - `type: "text"`
394416
395417 default: text
396418
419 - `text: string`
420
421 Text returned by the tool
422
397423 - `is_error: boolean`
398424
399425 True when the tool reported an error
from line 438
412438
413439 default: false
414440
415 - `type: "tool_result"`
416
417 default: tool_result
418
419441 - `created_at: string`
420442
421443 When the message was recorded (RFC 3339, UTC)
from line 456
434456
435457 The turn's content cannot be returned; `content` is empty.
436458
437 - `reason: string`
438
439 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.
440
441459 - `type: "content_unavailable"`
442460
443461 default: content_unavailable
444462
463 - `reason: string`
464
465 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.
466
445467 - `ClientAsserted object`
446468
447469 Assistant content the client supplied as conversation history
from line 499
477499 - `"assistant"`
478500
479501 - `"user"`
480
481 - `type: "compliance_local_session_message"`
482
483 default: compliance_local_session_message
484502