The whole hunk
from line 1, old and new numbered
/
lines
from line 1
1---
2title: Sessions
3url: https://platform.claude.com/docs/en/api/compliance/apps/sessions
4---
5
16# Sessions
27
38## Sessions › Local
from line 52
4752
4853#### Headers
4954
55- `"anthropic-version": optional string`
56
57 The version of the Claude API you want to use.
58
59 Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).
60
5061- `"x-api-key": optional string`
5162
5263#### Returns
from line 66
5566
5667 Page of local sessions, ordered by `created_at` descending; ties are broken by a fixed server-side order. `updated_at` never participates in the ordering; the `updated_at.gte` query parameter filters on it without changing the order or the pagination cursor.
5768
69 - `type: "compliance_local_session"`
70
71 default: compliance_local_session
72
5873 - `id: string`
5974
6075 Local session identifier, prefixed `clls_`. Unique within the parent organization. Treat as an opaque string; the format may change without notice.
from line 88
7388
7489 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.
7590
76 - `type: "compliance_local_session"`
91 - `truncated: boolean`
7792
78 default: compliance_local_session
93 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.
7994
95 default: false
96
8097 - `updated_at: string`
8198
8299 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 166
149166
150167#### Headers
151168
169- `"anthropic-version": optional string`
170
171 The version of the Claude API you want to use.
172
173 Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).
174
152175- `"x-api-key": optional string`
153176
154177#### Returns
155178
179- `type: "compliance_local_session"`
180
181 default: compliance_local_session
182
156183- `id: string`
157184
158185 Local session identifier, prefixed `clls_`. Unique within the parent organization. Treat as an opaque string; the format may change without notice.
from line 198
171198
172199 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.
173200
174- `type: "compliance_local_session"`
201- `truncated: boolean`
175202
176 default: compliance_local_session
203 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.
177204
205 default: false
206
178207- `updated_at: string`
179208
180209 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 307
278307
279308#### Headers
280309
310- `"anthropic-version": optional string`
311
312 The version of the Claude API you want to use.
313
314 Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).
315
281316- `"x-api-key": optional string`
282317
283318#### Returns
from line 321
286321
287322 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.
288323
324 - `type: "compliance_local_session_message"`
325
326 default: compliance_local_session_message
327
289328 - `id: string`
290329
291330 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 337
298337
299338 Text content block.
300339
340 - `type: "text"`
341
342 default: text
343
301344 - `text: string`
302345
303346 Text content from the user or the assistant
from line 351
308351
309352 default: false
310353
311 - `type: "text"`
312
313 default: text
314
315354 - `ToolUse object`
316355
317356 Tool invocation requested by the assistant.
318357
358 - `type: "tool_use"`
359
360 default: tool_use
361
319362 - `id: string or null`
320363
321364 Tool-use ID, e.g. 'toolu_01AbC...'
from line 377
334377
335378 default: false
336379
337 - `type: "tool_use"`
338
339 default: tool_use
340
341380 - `ToolResult object`
342381
343382 Result returned by a tool invocation.
344383
384 - `type: "tool_result"`
385
386 default: tool_result
387
345388 - `content: array of object`
346389
347390 Text content returned by the tool. Non-text item types are omitted and signalled via `truncated` with an in-band item-count marker.
348391
349 - `text: string`
350
351 Text returned by the tool
352
353392 - `type: "text"`
354393
355394 default: text
356395
396 - `text: string`
397
398 Text returned by the tool
399
357400 - `is_error: boolean`
358401
359402 True when the tool reported an error
from line 415
372415
373416 default: false
374417
375 - `type: "tool_result"`
376
377 default: tool_result
378
379418 - `created_at: string`
380419
381420 When the message was recorded (RFC 3339, UTC)
from line 433
394433
395434 The turn's content cannot be returned; `content` is empty.
396435
397 - `reason: string`
398
399 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.
400
401436 - `type: "content_unavailable"`
402437
403438 default: content_unavailable
404439
440 - `reason: string`
441
442 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.
443
405444 - `ClientAsserted object`
406445
407446 Assistant content the client supplied as conversation history
from line 477
438477
439478 - `"user"`
440479
441 - `type: "compliance_local_session_message"`
442
443 default: compliance_local_session_message
444
445480- `next_page: string or null`
446481
447482 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 485
450485
451486 The local session the messages belong to. `user.email_address` is always null on this endpoint; the messages endpoint does not resolve email addresses.
452487
488 - `type: "compliance_local_session"`
489
490 default: compliance_local_session
491
453492 - `id: string`
454493
455494 Local session identifier, prefixed `clls_`. Unique within the parent organization. Treat as an opaque string; the format may change without notice.
from line 507
468507
469508 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.
470509
471 - `type: "compliance_local_session"`
510 - `truncated: boolean`
472511
473 default: compliance_local_session
512 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.
474513
514 default: false
515
475516 - `updated_at: string`
476517
477518 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 572
531572 "created_at": "2025-03-12T18:22:41.123456Z",
532573 "organization_uuid": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
533574 "product_surface": "cowork",
575 "truncated": true,
534576 "type": "compliance_local_session",
535577 "updated_at": "2025-03-12T18:22:41.123456Z",
536578 "user": {
from line 660
618660
619661#### Headers
620662
663- `"anthropic-version": optional string`
664
665 The version of the Claude API you want to use.
666
667 Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).
668
621669- `"x-api-key": optional string`
622670
623671#### Returns
from line 835
787835
788836#### Headers
789837
838- `"anthropic-version": optional string`
839
840 The version of the Claude API you want to use.
841
842 Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).
843
790844- `"x-api-key": optional string`
791845
792846#### Returns
from line 861
807861
808862 Text content block.
809863
864 - `type: "text"`
865
866 default: text
867
810868 - `text: string`
811869
812870 Text content from the user or the assistant
from line 875
817875
818876 default: false
819877
820 - `type: "text"`
821
822 default: text
823
824878 - `ToolUse object`
825879
826880 Tool invocation requested by the assistant.
827881
882 - `type: "tool_use"`
883
884 default: tool_use
885
828886 - `id: string or null`
829887
830888 Tool-use ID, e.g. 'toolu_01AbC...'
from line 901
843901
844902 default: false
845903
846 - `type: "tool_use"`
847
848 default: tool_use
849
850904 - `ToolResult object`
851905
852906 Result returned by a tool invocation.
853907
908 - `type: "tool_result"`
909
910 default: tool_result
911
854912 - `content: array of object`
855913
856914 Text content returned by the tool. Non-text item types are omitted.
857915
858 - `text: string`
859
860 Text returned by the tool
861
862916 - `type: "text"`
863917
864918 default: text
865919
920 - `text: string`
921
922 Text returned by the tool
923
866924 - `is_error: boolean`
867925
868926 True when the tool reported an error
from line 938
880938 True when one or more text items in `content` were shortened. Pass `tool_result_max_bytes=-1` to request full content, subject to the server-side maximum.
881939
882940 default: false
883
884 - `type: "tool_result"`
885
886 default: tool_result
887941
888942 - `content_unavailable: boolean`
889943