from line 1
1---
2title: Retrieve local session messages
3url: https://platform.claude.com/docs/en/api/compliance/apps/sessions/local/messages/list
4---
1# Retrieve local session messages
52
6## Retrieve local session messages
3**GET** `/v1/compliance/apps/sessions/local/{local_session_id}/messages`
74
8**get** `/v1/compliance/apps/sessions/local/{local_session_id}/messages`
9
105Read one local session's transcript, oldest-first by default.
116
127Retention is enforced read-side: turns at or before the child
from line 12
1712honored for 24 hours: a cursor older than that is rejected with an
1813explicit 400; restart the walk to read under the current boundary.
1914
20### Path Parameters
15## Path parameters
2116
2217- `local_session_id: string`
2318
24### Query Parameters
19## Query parameters
2520
2621- `limit: optional number`
2722
2823 Maximum results (default: 100, max: 1000)
2924
25 default: 100, maximum: 1000, minimum: 1
26
3027- `order: optional "asc" or "desc"`
3128
3229 Sort direction. `asc` (oldest-first, default) or `desc`.
3330
31 default: asc
32
3433 - `"asc"`
3534
3635 - `"desc"`
from line 42
4342
4443 Truncate each text item inside a tool result to at most this many bytes (cut on a code-point boundary). Pass `-1` to request the server maximum (approximately 1 MiB); larger values are clamped to it. `0` is not a valid value.
4544
45 default: 10000, maximum: 2147483647, minimum: -1
46
4647- `tool_use_input_max_bytes: optional number`
4748
4849 Truncate each tool-use input to at most this many bytes (cut on a code-point boundary so the result is valid UTF-8). Pass `-1` to request the server maximum (approximately 1 MiB); larger values are clamped to it. `0` is not a valid value.
4950
50### Header Parameters
51 default: 10000, maximum: 2147483647, minimum: -1
5152
53## Headers
54
5255- `"x-api-key": optional string`
5356
54### Returns
57## Returns
5558
56- `data: array of object { id, content, created_at, 4 more }`
59- `data: array of object`
5760
5861 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.
5962
from line 64
6164
6265 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.
6366
64 - `content: array of object { text, truncated, type } or object { id, input, name, 2 more } or object { content, is_error, name, 3 more }`
67 - `content: array of object or object or object`
6568
6669 Content blocks within the message, discriminated on `type` (`text` / `tool_use` / `tool_result`: the same discriminator values as the claude.ai chat-messages endpoint; the tool variants omit `integration_name` and `mcp_server_url`, and `text` carries `truncated`). Extended-thinking content is never included. The request's `system` field is never included; a presence-only marker message is emitted when it was set. The request's `tools[]` definitions are never included as transcript messages. Project-level instructions (such as CLAUDE.md files) appear in the message stream as a user-role context block and are included. Empty when `provenance.type` is `content_unavailable`.
6770
68 - `Text object { text, truncated, type }`
71 - `Text object`
6972
7073 Text content block.
7174
from line 80
7780
7881 True when `text` was shortened by the server's fixed per-string bound (approximately 1 MiB), or when ancillary content the block carried (such as citations) was omitted, or when this block stands in for a non-text block whose content is not shown, or when it is an explanatory marker the server inserted (its text enclosed in square brackets, e.g. prefacing client-asserted history). There is no request parameter that raises the per-string bound.
7982
83 default: false
84
8085 - `type: "text"`
8186
82 - `"text"`
87 default: text
8388
84 - `ToolUse object { id, input, name, 2 more }`
89 - `ToolUse object`
8590
8691 Tool invocation requested by the assistant.
8792
from line 106
101106
102107 True when `input` was shortened. Pass `tool_use_input_max_bytes=-1` to request the server maximum.
103108
109 default: false
110
104111 - `type: "tool_use"`
105112
106 - `"tool_use"`
113 default: tool_use
107114
108 - `ToolResult object { content, is_error, name, 3 more }`
115 - `ToolResult object`
109116
110117 Result returned by a tool invocation.
111118
112 - `content: array of object { text, type }`
119 - `content: array of object`
113120
114121 Text content returned by the tool. Non-text item types are omitted and signalled via `truncated` with an in-band item-count marker.
115122
from line 126
119126
120127 - `type: "text"`
121128
122 - `"text"`
129 default: text
123130
124131 - `is_error: boolean`
125132
from line 144
137144
138145 True when one or more text items in `content` were shortened or non-text items were omitted. Pass `tool_result_max_bytes=-1` to request the server maximum.
139146
147 default: false
148
140149 - `type: "tool_result"`
141150
142 - `"tool_result"`
151 default: tool_result
143152
144153 - `created_at: string`
145154
146155 When the message was recorded (RFC 3339, UTC)
147156
157 format: date-time
158
148159 - `model: string or null`
149160
150161 The model that served this assistant turn, as reported in the `model` field of the underlying Messages API response. Null on user messages and on any assistant message whose `provenance` is set: client-asserted history and synthetic markers were not produced by a model during this session, and for unavailable content the serving model is not known.
151162
152 - `provenance: object { reason, type } or object { type } or object { type } or null`
163 - `provenance: object or object or object or null`
153164
154165 Where this turn's content came from, discriminated on `type`. Null (the common case) means verified content: on an assistant message, content Claude produced during this session; on a user message, content the user sent. `content_unavailable`: the turn's content cannot be returned and `content` is empty; `reason` says why. `client_asserted`: assistant content the client supplied as conversation history; `content` shows what the model received but its authorship is not verified; never on user-role messages. `synthetic_marker`: a transcript marker the endpoint generated rather than content either party sent during the session. Both `client_asserted` and `synthetic_marker` can result from normal request or client processing, not only client modification. Callers should tolerate unrecognized `type` values.
155166
156 - `ContentUnavailable object { reason, type }`
167 - `ContentUnavailable object`
157168
158169 The turn's content cannot be returned; `content` is empty.
159170
from line 174
163174
164175 - `type: "content_unavailable"`
165176
166 - `"content_unavailable"`
177 default: content_unavailable
167178
168 - `ClientAsserted object { type }`
179 - `ClientAsserted object`
169180
170181 Assistant content the client supplied as conversation history
171182 rather than produced by Claude during this session. `content` shows
from line 186
175186
176187 - `type: "client_asserted"`
177188
178 - `"client_asserted"`
189 default: client_asserted
179190
180 - `SyntheticMarker object { type }`
191 - `SyntheticMarker object`
181192
182193 A transcript marker generated by the endpoint rather than sent by
183194 either party during the session. Marker messages indicate that the
from line 202
191202
192203 - `type: "synthetic_marker"`
193204
194 - `"synthetic_marker"`
205 default: synthetic_marker
195206
196207 - `role: "assistant" or "user"`
197208
from line 214
203214
204215 - `type: "compliance_local_session_message"`
205216
206 - `"compliance_local_session_message"`
217 default: compliance_local_session_message
207218
208219- `next_page: string or null`
209220
210221 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.
211222
212- `session: object { id, created_at, organization_uuid, 5 more }`
223- `session: object`
213224
214225 The local session the messages belong to. `user.email_address` is always null on this endpoint; the messages endpoint does not resolve email addresses.
215226
from line 232
221232
222233 Timestamp of the session's first retained inference call (RFC 3339, UTC). When a session's activity spans the child organization's retention boundary, calls older than the boundary are no longer reflected, so this value is the timestamp of the earliest retained call: always strictly after the boundary, never the boundary itself.
223234
235 format: date-time
236
224237 - `organization_uuid: string`
225238
226239 UUID of the child organization the session belongs to
from line 244
231244
232245 - `type: "compliance_local_session"`
233246
234 - `"compliance_local_session"`
247 default: compliance_local_session
235248
236249 - `updated_at: string`
237250
238251 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.
239252
240 - `user: object { id, email_address }`
253 format: date-time
241254
255 - `user: object`
256
242257 The authenticated user at the time of the session. Always set; `user.id` is always populated. `user.email_address` is null when the user's account has been deleted or the user is no longer a member of an organization the key may read.
243258
244259 - `id: string`
from line 268
253268
254269 Workspace identifier (tagged ID, prefixed `wrkspc_`). Null for sessions not attributed to a workspace.
255270
256### Example
271## Example
257272
258```http
273```bash
259274curl https://api.anthropic.com/v1/compliance/apps/sessions/local/$LOCAL_SESSION_ID/messages \
260275 -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"
261276```
262277
263#### Response
278### Response (200)
264279
265280```json
266281{
No line in this hunk matches that.