from line 1
1---
2title: Get chat messages
3url: https://platform.claude.com/docs/en/api/compliance/apps/chats/messages/list
4---
1# Get chat messages
52
6## Get chat messages
3**GET** `/v1/compliance/apps/chats/{claude_chat_id}/messages`
74
8**get** `/v1/compliance/apps/chats/{claude_chat_id}/messages`
9
105Retrieves message history and file metadata for a specific chat.
116
12### Path Parameters
7## Path parameters
138
149- `claude_chat_id: string`
1510
1611 The chat ID (tagged ID, e.g., claude_chat_abc123)
1712
18### Query Parameters
13## Query parameters
1914
2015- `after_id: optional string`
2116
from line 20
2520
2621 Pagination cursor for retrieving the previous page of results. To paginate, pass the `first_id` value from the most recent response. 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.
2722
28- `created_at: optional object { gt, gte, lt, lte }`
23- `created_at: optional object`
2924
3025 - `gt: optional string`
3126
3227 Filter messages created after this time (RFC 3339 format)
3328
29 format: date-time
30
3431 - `gte: optional string`
3532
3633 Filter messages created at or after this time (RFC 3339 format)
3734
35 format: date-time
36
3837 - `lt: optional string`
3938
4039 Filter messages created before this time (RFC 3339 format)
4140
41 format: date-time
42
4243 - `lte: optional string`
4344
4445 Filter messages created at or before this time (RFC 3339 format)
4546
47 format: date-time
48
4649- `limit: optional number`
4750
4851 Maximum results (max: 1000). When omitted, the full result set is returned in one response.
4952
53 maximum: 1000, minimum: 1
54
5055- `order: optional "asc" or "desc"`
5156
5257 Sort direction for messages within the response. `asc` (the default) returns oldest-first; `desc` returns newest-first.
5358
59 default: asc
60
5461 - `"asc"`
5562
5663 - `"desc"`
from line 66
5966
6067 Maximum characters returned per tool-result text item. Items longer than this are shortened and the block's `truncated` field is set. Pass -1 to disable the limit.
6168
69 default: 10000, minimum: -1
70
6271- `tool_use_input_max_chars: optional number`
6372
6473 Maximum characters of JSON-encoded tool input returned per tool_use block. Inputs longer than this are shortened and the block's `truncated` field is set. Pass -1 to disable the limit.
6574
66- `updated_at: optional object { gt, gte, lt, lte }`
75 default: 10000, minimum: -1
6776
77- `updated_at: optional object`
78
6879 - `gt: optional string`
6980
7081 Filter messages updated after this time (RFC 3339 format)
7182
83 format: date-time
84
7285 - `gte: optional string`
7386
7487 Filter messages updated at or after this time (RFC 3339 format)
7588
89 format: date-time
90
7691 - `lt: optional string`
7792
7893 Filter messages updated before this time (RFC 3339 format)
7994
95 format: date-time
96
8097 - `lte: optional string`
8198
8299 Filter messages updated at or before this time (RFC 3339 format)
83100
84### Header Parameters
101 format: date-time
85102
103## Headers
104
86105- `"x-api-key": optional string`
87106
88### Returns
107## Returns
89108
90109- `id: string`
91110
92111 Chat ID
93112
94- `chat_messages: array of object { id, artifacts, content, 4 more }`
113- `chat_messages: array of object`
95114
96115 Array of chat messages in order of created_at
97116
from line 118
99118
100119 Unique identifier for the message e.g. 'claude_chat_msg_abcd1234'
101120
102 - `artifacts: array of object { id, artifact_type, title, version_id } or null`
121 - `artifacts: array of object or null`
103122
104123 Versioned documents generated or updated by the assistant in this message. Download via `GET /v1/compliance/apps/artifacts/{artifact_version_id}/content`.
105124
from line 138
119138
120139 Artifact version ID e.g. 'claude_artifact_version_abc123'
121140
122 - `content: array of object { text, thinking_redacted, truncated, type } or object { id, input, integration_name, 4 more } or object { content, integration_name, is_error, 5 more }`
141 - `content: array of object or object or object`
123142
124143 Content blocks within the message
125144
126 - `Text object { text, thinking_redacted, truncated, type }`
145 - `Text object`
127146
128147 Text content block.
129148
from line 154
135154
136155 True when content enclosed in the assistant's internal-reasoning tags (or the tag markup itself) was removed from `text` during export. Removal never occurs with this field false. Always false on human messages, whose text is exported verbatim.
137156
157 default: false
158
138159 - `truncated: boolean`
139160
140161 True when `text` was shortened by the server's fixed per-string bound (1 MiB). Always false on chat text blocks.
141162
163 default: false
164
142165 - `type: "text"`
143166
144 - `"text"`
167 default: text
145168
146 - `ToolUse object { id, input, integration_name, 4 more }`
169 - `ToolUse object`
147170
148171 Tool invocation requested by the assistant.
149172
from line 194
171194
172195 True when `input` was shortened. Pass the endpoint's tool-use input max parameter as -1 to request full content, subject to any server-side maximum the endpoint enforces.
173196
197 default: false
198
174199 - `type: "tool_use"`
175200
176 - `"tool_use"`
201 default: tool_use
177202
178 - `ToolResult object { content, integration_name, is_error, 5 more }`
203 - `ToolResult object`
179204
180205 Result returned by a tool invocation.
181206
182 - `content: array of object { text, type }`
207 - `content: array of object`
183208
184209 Text content returned by the tool. Generated files are surfaced via the message's `generated_files` list; other non-text item types (including images and links) are omitted.
185210
from line 214
189214
190215 - `type: "text"`
191216
192 - `"text"`
217 default: text
193218
194219 - `integration_name: string or null`
195220
from line 240
215240
216241 True when one or more text items in `content` were shortened. Pass the endpoint's tool-result max parameter as -1 to request full content, subject to any server-side maximum the endpoint enforces.
217242
243 default: false
244
218245 - `type: "tool_result"`
219246
220 - `"tool_result"`
247 default: tool_result
221248
222249 - `created_at: string`
223250
224251 Message creation timestamp - For human: when they sent the message, For assistant: when it completed the last content block
225252
226 - `files: array of object { id, created_at, filename, 3 more } or null`
253 format: date-time
227254
255 - `files: array of object or null`
256
228257 Binary file attachments uploaded by the user. Download via `GET /v1/compliance/apps/chats/files/{claude_file_id}/content`.
229258
230259 - `id: string`
from line 264
235264
236265 File creation timestamp
237266
267 format: date-time
268
238269 - `filename: string`
239270
240271 Display name of the file
from line 282
251282
252283 Size in bytes of the file's preferred downloadable variant, if known. Null for older files uploaded before size was recorded.
253284
254 - `generated_files: array of object { id, filename, md5, 2 more } or null`
285 - `generated_files: array of object or null`
255286
256287 Downloadable files the assistant created via tool use (e.g. PDF, spreadsheet, slide deck). Distinct from `files`, which are uploads attached to the message. Download via `GET /v1/compliance/apps/chats/generated-files/{claude_gen_file_id}/content`.
257288
from line 318
287318
288319 Creation timestamp
289320
321 format: date-time
322
290323- `deleted_at: string or null`
291324
292325 Deletion timestamp if deleted
293326
327 format: date-time
328
294329- `first_id: string or null`
295330
296331 Opaque pagination cursor for the first message in the current result set. Pass as `before_id` on the next request to page backwards. 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.
from line 334
299334
300335 Whether more chat messages exist beyond the current result set. Use `last_id` as `after_id` in a follow-up request to page forward.
301336
337 default: false
338
302339- `href: string`
303340
304341 URL to view this chat in claude.ai
from line 352
315352
316353 Chat name
317354
318- `organization_id: string`
319
320 Organization ID this chat belongs to
321
322355- `organization_uuid: string`
323356
324357 Organization UUID this chat belongs to
from line 364
331364
332365 Last update timestamp
333366
334- `user: object { id, email_address } or null`
367 format: date-time
335368
369- `user: object or null`
370
336371 User information for compliance responses.
337372
338373 - `id: string`
from line 378
343378
344379 User's email address
345380
346### Example
381- `organization_id: string`
347382
348```http
383 **Deprecated**
384
385 Organization ID this chat belongs to
386
387## Example
388
389```bash
349390curl https://api.anthropic.com/v1/compliance/apps/chats/$CLAUDE_CHAT_ID/messages \
350391 -H "Authorization: Bearer $ANTHROPIC_COMPLIANCE_API_KEY"
351392```
352393
353#### Response
394### Response (200)
354395
355396```json
356397{
No line in this hunk matches that.