v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-1330180264.7 KB
spaces

Updates a message. There's a difference between the patch and update methods. The patch method uses a patch request while the update method uses a put request. We recommend using the patch method. For an example, see Update a message. Supports the following types of authentication: - App authentication with the authorization scope: - https://www.googleapis.com/auth/chat.bot - User authentication with one of the following authorization scopes: - https://www.googleapis.com/auth/chat.messages - https://www.googleapis.com/auth/chat.import (import mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app.

put/v1/{+name}

Path parameters

namestring required

Identifier. Resource name of the message. Format: spaces/{space}/messages/{message} Where {space} is the ID of the space where the message is posted and {message} is a system-assigned ID for the message. For example, spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing {message} with the value from the clientAssignedMessageId field. For example, spaces/AAAAAAAAAAA/messages/client-custom-name. For details, see Name a message.

Query parameters

allowMissingboolean

Optional. If true and the message isn't found, a new message is created and updateMask is ignored. The specified message ID must be client-assigned or the request fails.

updateMaskstring

Required. The field paths to update. Separate multiple values with commas or use * to update all field paths. Currently supported field paths: - text - attachment - cards (Requires app authentication.) - cards_v2 (Requires app authentication.) - accessory_widgets (Requires app authentication.) - quoted_message_metadata (Only allows removal of the quoted message.)

Request body

deleteTimestring google-datetime

Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty.

clientAssignedMessageIdstring

Optional. A custom ID for the message. You can use field to identify a message, or to get, delete, or update a message. To set a custom ID, specify the messageId field when you create the message. For details, see Name a message.

textstring

Optional. Plain-text body of the message. The first link to an image, video, or web page generates a preview chip. You can also @mention a Google Chat user, or everyone in the space. To learn about creating text messages, see Send a message.

createTimestring google-datetime

Optional. Immutable. For spaces created in Chat, the time at which the message was created. This field is output only, except when used in import mode spaces. For import mode spaces, set this field to the historical timestamp at which the message was created in the source in order to preserve the original creation time.

namestring

Identifier. Resource name of the message. Format: spaces/{space}/messages/{message} Where {space} is the ID of the space where the message is posted and {message} is a system-assigned ID for the message. For example, spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB. If you set a custom ID when you create a message, you can use this ID to specify the message in a request by replacing {message} with the value from the clientAssignedMessageId field. For example, spaces/AAAAAAAAAAA/messages/client-custom-name. For details, see Name a message.

threadReplyboolean

Output only. When true, the message is a response in a reply thread. When false, the message is visible in the space's top-level conversation as either the first message of a thread or a message with no threaded replies. If the space doesn't support reply in threads, this field is always false.

fallbackTextstring

Optional. A plain-text description of the message's cards, used when the actual cards can't be displayed—for example, mobile notifications.

argumentTextstring

Output only. Plain-text body of the message with all Chat app mentions stripped out.

formattedTextstring

Output only. Contains the message text with markups added to communicate formatting. This field might not capture all formatting visible in the UI, but includes the following: * Markup syntax for bold, italic, strikethrough, monospace, monospace block, bulleted list, and block quote. * User mentions using the format . * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the first string is the URL and the second is the rendered text—for example, . * Custom emoji using the format :{emoji_name}:—for example, :smile:. This doesn't apply to Unicode emoji, such as U+1F600 for a grinning face emoji. * Bullet list items using asterisks (*)—for example, * item. For more information, see View text formatting sent in a message

lastUpdateTimestring google-datetime

Output only. The time at which the message was last edited by a user. If the message has never been edited, this field is empty.

silentboolean

Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.

Response

Successful response