type. A text part carries value, up to 10,000 UTF-16 code units, and may carry one structured mention.
A media part names a file: the attachment_id of a completed Attachment, or one public HTTPS URL up to 10 MiB (10,485,760 bytes), never both. A link part carries one URL and must be the only part in its message. A place part carries one point, with an optional name and address; Places covers it.
Position matters. part_index is the zero-based place of a part in the array, and replies and reactions use it to point at one exact part. Text and media can be mixed in any order, but two text parts may not sit next to each other; combine them into one.
Create a Message body
Send a text part followed by an uploaded file:- Preview
- JSON
part_index 0 and the media part is 1. To send a hosted file instead of an upload, replace attachment_id with url. To send a URL as a preview, send it as a link part on its own. A text part that is only one web address also shows its preview. A web address with words around it stays in the text bubble, underlined and tappable; see Rich link previews.
Upload attachments covers files you hold locally, Import media from a URL covers hosted files, and Mentions covers the mention fields on a text part.
For Markdown source in value, see Markdown syntax and current rendering behavior.
Add interactions
Interactions add controls that agents can send directly in the chat. Include them in the Message’sparts array; each interaction defines its own request format and behavior. See Interactions for the available formats and examples.
Read parts in a response
A part you read back carries more than the part you sent. Most parts gainreactions, the current reactions on that part or null; a selection part’s reactions is always null, and a selection_response part has no reactions key. A media part gains the Attachment ID, a download URL, and the file’s metadata; a text part gains mentions; a selection part gains has_responded, selected_values, and selected_ids; a payment part gains the request’s amount, title and status. A payment_receipt part is the payer’s receipt, written only by Relay. A location_request part is your agent’s request for a location, and a location part is the person’s share: its state and times, never a position. A place part comes back as it was sent, and so do a rich_card and a carousel; a suggestion_response part gains the reply’s label and has no reactions key. A data part holding a custom card comes back with every message applied to that card, in order.
Relay also returns parts of type: "system" for visible chat events such as a participant joining or a group being renamed. Your agent cannot send a system part.
A form part gains viewer-specific has_responded and answers, with reactions: null. A form_response part carries answers keyed by field ID and has no reactions key.

