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/chats/messages
4---
5
16# Messages
27
38## Get chat messages
from line 109
104109
105110### Headers
106111
112- `"anthropic-version": optional string`
113
114 The version of the Claude API you want to use.
115
116 Read more about versioning and our version history [here](https://platform.claude.com/docs/en/api/versioning).
117
107118- `"x-api-key": optional string`
108119
109120### Returns
from line 159
148159
149160 Text content block.
150161
162 - `type: "text"`
163
164 default: text
165
151166 - `text: string`
152167
153168 Text content from human or assistant
from line 179
164179
165180 default: false
166181
167 - `type: "text"`
168
169 default: text
170
171182 - `ToolUse object`
172183
173184 Tool invocation requested by the assistant.
174185
186 - `type: "tool_use"`
187
188 default: tool_use
189
175190 - `id: string or null`
176191
177192 Tool-use ID, e.g. 'toolu_01AbC...'
from line 213
198213
199214 default: false
200215
201 - `type: "tool_use"`
202
203 default: tool_use
204
205216 - `ToolResult object`
206217
207218 Result returned by a tool invocation.
208219
220 - `type: "tool_result"`
221
222 default: tool_result
223
209224 - `content: array of object`
210225
211226 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.
212227
213 - `text: string`
214
215 Text returned by the tool
216
217228 - `type: "text"`
218229
219230 default: text
220231
232 - `text: string`
233
234 Text returned by the tool
235
221236 - `integration_name: string or null`
222237
223238 Name of the integration that provides this tool, when applicable
from line 259
244259
245260 default: false
246261
247 - `type: "tool_result"`
248
249 default: tool_result
250
251262 - `created_at: string`
252263
253264 Message creation timestamp - For human: when they sent the message, For assistant: when it completed the last content block
from line 381
370381
371382- `user: object or null`
372383
373 User information for compliance responses.
384 The user who created the chat.
374385
386 Null when the API key is restricted to one organization and the creator
387 is no longer a member of it (for example, after they were removed from
388 it).
389
390 A key for the whole parent organization returns the creator's `id`
391 and current `email_address` for every chat; on the list endpoint, pass
392 `organization_ids[]` to keep the results to one organization. For the
393 email address the creator had when the chat was created, query
394 `GET /v1/compliance/activities` with `activity_types[]=claude_chat_created`
395 and a `created_at` window around the chat's `created_at`, find the event
396 whose `claude_chat_id` matches this chat's `id`, and read
397 `actor.email_address`. These events exist only for chats created after
398 compliance logging was enabled for the organization.
399
375400 - `id: string`
376401
377402 User identifier
from line 523
498523
499524 Text content block.
500525
526 - `type: "text"`
527
528 default: text
529
501530 - `text: string`
502531
503532 Text content from human or assistant
from line 543
514543
515544 default: false
516545
517 - `type: "text"`
518
519 default: text
520
521546 - `ToolUse object`
522547
523548 Tool invocation requested by the assistant.
524549
550 - `type: "tool_use"`
551
552 default: tool_use
553
525554 - `id: string or null`
526555
527556 Tool-use ID, e.g. 'toolu_01AbC...'
from line 577
548577
549578 default: false
550579
551 - `type: "tool_use"`
552
553 default: tool_use
554
555580 - `ToolResult object`
556581
557582 Result returned by a tool invocation.
558583
584 - `type: "tool_result"`
585
586 default: tool_result
587
559588 - `content: array of object`
560589
561590 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.
562591
563 - `text: string`
564
565 Text returned by the tool
566
567592 - `type: "text"`
568593
569594 default: text
570595
596 - `text: string`
597
598 Text returned by the tool
599
571600 - `integration_name: string or null`
572601
573602 Name of the integration that provides this tool, when applicable
from line 622
593622 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.
594623
595624 default: false
596
597 - `type: "tool_result"`
598
599 default: tool_result
600625
601626 - `created_at: string`
602627