---
title: "PUT /v1/{+name}"
method: PUT
path: "/v1/{+name}"
tags: ["spaces"]
---

# PUT /v1/{+name}

`PUT /v1/{+name}`

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](https://developers.google.com/workspace/chat/update-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) 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.

## Path parameters

- `name` string, required

## Query parameters

- `allowMissing` boolean
- `updateMask` string

## Request body

- Message — A message in a Google Chat space.
  - `deleteTime` string, 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.
  - `clientAssignedMessageId` string — 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`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id) field when you create the message. For details, see [Name a message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).
  - `accessoryWidgets` AccessoryWidget[] — Optional. One or more interactive widgets that appear at the bottom of a message. You can add accessory widgets to messages that contain text, cards, or both text and cards. Not supported for messages that contain dialogs. For details, see [Add interactive widgets at the bottom of a message](https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets). Creating a message with accessory widgets requires [app authentication] (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).
    - `buttonList` GoogleAppsCardV1ButtonList — A list of buttons layed out horizontally. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
      - `buttons` GoogleAppsCardV1Button[] — An array of buttons.
        - `icon` GoogleAppsCardV1Icon — An icon displayed in a widget on a card. For an example in Google Chat apps, see [Add an icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). Supports [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) and [custom](https://developers.google.com/workspace/chat/format-messages#customicons) icons. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
          - `knownIcon` string — Display one of the built-in icons provided by Google Workspace. For example, to display an airplane icon, specify `AIRPLANE`. For a bus, specify `BUS`. For a full list of supported icons, see [built-in icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
          - `iconUrl` string — Display a custom icon hosted at an HTTPS URL. For example: ``` "iconUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png" ``` Supported file types include `.png` and `.jpg`.
          - `materialIcon` GoogleAppsCardV1MaterialIcon — A [Google Material Icon](https://fonts.google.com/icons), which includes over 2500+ options. For example, to display a [checkbox icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048) with customized weight and grade, write the following: ``` { "name": "check_box", "fill": true, "weight": 300, "grade": -25 } ``` [Google Chat apps](https://developers.google.com/workspace/chat):
            - `weight` integer — The stroke weight of the icon. Choose from {100, 200, 300, 400, 500, 600, 700}. If absent, default value is 400. If any other value is specified, the default value is used. To preview different icon settings, go to [Google Font Icons](https://fonts.google.com/icons) and adjust the settings under **Customize**.
            - `name` string — The icon name defined in the [Google Material Icon](https://fonts.google.com/icons), for example, `check_box`. Any invalid names are abandoned and replaced with empty string and results in the icon failing to render.
            - `fill` boolean — Whether the icon renders as filled. Default value is false. To preview different icon settings, go to [Google Font Icons](https://fonts.google.com/icons) and adjust the settings under **Customize**.
            - `grade` integer — Weight and grade affect a symbol’s thickness. Adjustments to grade are more granular than adjustments to weight and have a small impact on the size of the symbol. Choose from {-25, 0, 200}. If absent, default value is 0. If any other value is specified, the default value is used. To preview different icon settings, go to [Google Font Icons](https://fonts.google.com/icons) and adjust the settings under **Customize**.
          - `imageType` 'SQUARE' | 'CIRCLE' — The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a built-in icon.
          - `altText` string — Optional. A description of the icon used for accessibility. If unspecified, the default value `Button` is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, `A user's account portrait`, or `Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat`. If the icon is set in a `Button`, the `altText` appears as helper text when the user hovers over the button. However, if the button also sets `text`, the icon's `altText` is ignored.
        - `altText` string — The alternative text that's used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat".
        - `disabled` boolean — If `true`, the button is displayed in an inactive state and doesn't respond to user actions.
        - `color` Color — Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...
          - `green` number, float — The amount of green in the color as a value in the interval [0, 1].
          - `red` number, float — The amount of red in the color as a value in the interval [0, 1].
          - `blue` number, float — The amount of blue in the color as a value in the interval [0, 1].
          - `alpha` number, float — The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
        - `type` 'TYPE_UNSPECIFIED' | 'OUTLINED' | 'FILLED' | 'FILLED_TONAL' | 'BORDERLESS' — Optional. The type of a button. If unset, button type defaults to `OUTLINED`. If the `color` field is set, the button type is forced to `FILLED` and any value set for this field is ignored.
        - `text` string — The text displayed inside the button.
        - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
          - `openLink` GoogleAppsCardV1OpenLink — Represents an `onClick` event that opens a hyperlink. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `url` string — The URL to open. HTTP URLs are converted to HTTPS.
            - `openAs` 'FULL_SIZE' | 'OVERLAY' — How to open a link. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
            - `onClose` 'NOTHING' | 'RELOAD' — Whether the client forgets about a link after opening it, or observes it until the window closes. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
          - `card` GoogleAppsCardV1Card — A card interface displayed in a Google Chat message or Google Workspace add-on. Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed information, gather information from users, and guide users to take a next step. [Card builder](https://addons.gsuite.google.com/uikit/builder) To learn how to build cards, see the following documentation: * For Google Chat apps, see [Design the components of a card or dialog](https://developers.google.com/workspace/chat/design-components-card-dialog). * For Google Workspace add-ons, see [Card-based interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards). Note: You can add up to 100 widgets per card. If a section's widgets push the total count above 100, that entire section and all following sections are ignored. This limit applies to both card messages and dialogs in Google Chat apps, and to cards in Google Workspace add-ons. **Example: Card message for a Google Chat app** ![Example contact card](https://developers.google.com/workspace/chat/images/card_api_reference.png) To create the sample card message in Google Chat, use the following JSON: ``` { "cardsV2": [ { "cardId": "unique-card-id", "card": { "header": { "title": "Sasha", "subtitle": "Software Engineer", "imageUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", "imageType": "CIRCLE", "imageAltText": "Avatar for Sasha" }, "sections": [ { "header": "Contact Info", "collapsible": true, "uncollapsibleWidgetsCount": 1, "widgets": [ { "decoratedText": { "startIcon": { "knownIcon": "EMAIL" }, "text": "sasha@example.com" } }, { "decoratedText": { "startIcon": { "knownIcon": "PERSON" }, "text": "Online" } }, { "decoratedText": { "startIcon": { "knownIcon": "PHONE" }, "text": "+1 (555) 555-1234" } }, { "buttonList": { "buttons": [ { "text": "Share", "onClick": { "openLink": { "url": "https://example.com/share" } } }, { "text": "Edit", "onClick": { "action": { "function": "goToView", "parameters": [ { "key": "viewType", "value": "EDIT" } ] } } } ] } } ] } ] } } ] } ```
            - `header` GoogleAppsCardV1CardHeader — Represents a card header. For an example in Google Chat apps, see [Add a header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `sections` GoogleAppsCardV1Section[] — Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see [Define a section of a card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
              - …
            - `name` string — Name of the card. Used as a card identifier in card navigation. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
            - `fixedFooter` GoogleAppsCardV1CardFixedFooter — A persistent (sticky) footer that that appears at the bottom of the card. Setting `fixedFooter` without specifying a `primaryButton` or a `secondaryButton` causes an error. For Chat apps, you can use fixed footers in [dialogs](https://developers.google.com/workspace/chat/dialogs), but not [card messages](https://developers.google.com/workspace/chat/create-messages#create). For an example in Google Chat apps, see [Add a persistent footer](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `expressionData` GoogleAppsCardV1ExpressionData[] — The expression data for the card. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
              - …
            - `sectionDividerStyle` 'DIVIDER_STYLE_UNSPECIFIED' | 'SOLID_DIVIDER' | 'NO_DIVIDER' — The divider style between the header, sections and footer.
            - `cardActions` GoogleAppsCardV1CardAction[] — The card's actions. Actions are added to the card's toolbar menu. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons): For example, the following JSON constructs a card action menu with `Settings` and `Send Feedback` options: ``` "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] ```
              - …
            - `displayStyle` 'DISPLAY_STYLE_UNSPECIFIED' | 'PEEK' | 'REPLACE' — In Google Workspace add-ons, sets the display properties of the `peekCardHeader`. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
            - `peekCardHeader` GoogleAppsCardV1CardHeader — Represents a card header. For an example in Google Chat apps, see [Add a header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
          - `overflowMenu` GoogleAppsCardV1OverflowMenu — A widget that presents a pop-up menu with one or more actions that users can invoke. For example, showing non-primary actions in a card. You can use this widget when actions don't fit in the available space. To use, specify this widget in the `OnClick` action of widgets that support it. For example, in a `Button`. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `items` GoogleAppsCardV1OverflowMenuItem[] — Required. The list of menu options.
              - …
          - `action` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `interaction` 'INTERACTION_UNSPECIFIED' | 'OPEN_DIALOG' — Optional. Required when opening a [dialog](https://developers.google.com/workspace/chat/dialogs). What to do in response to an interaction with a user, such as a user clicking a button in a card message. If unspecified, the app responds by executing an `action`—like opening a link or running a function—as normal. By specifying an `interaction`, the app can respond in special interactive ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can open a [dialog](https://developers.google.com/workspace/chat/dialogs). When specified, a loading indicator isn't shown. If specified for an add-on, the entire card is stripped and nothing is shown in the client. [Google Chat apps](https://developers.google.com/workspace/chat):
            - `persistValues` boolean — Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. To let the user make changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `NONE`. For [card messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) in Chat apps, you must also set the action's [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) to `UPDATE_MESSAGE` and use the same [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) from the card that contained the action. If `false`, the form values are cleared when the action is triggered. To prevent the user from making changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `SPINNER`.
            - `requiredWidgets` string[] — Optional. Fill this list with the names of widgets that this Action needs for a valid submission. If the widgets listed here don't have a value when this Action is invoked, the form submission is aborted. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `allWidgetsAreRequired` boolean — Optional. If this is true, then all widgets are considered required by this action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `function` string — A custom function to invoke when the containing element is clicked or otherwise activated. For example usage, see [Read form data](https://developers.google.com/workspace/chat/read-form-data).
            - `parameters` GoogleAppsCardV1ActionParameter[] — List of action parameters.
              - …
            - `loadIndicator` 'SPINNER' | 'NONE' — Specifies the loading indicator that the action displays while making the call to the action.
          - `openDynamicLinkAction` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `interaction` 'INTERACTION_UNSPECIFIED' | 'OPEN_DIALOG' — Optional. Required when opening a [dialog](https://developers.google.com/workspace/chat/dialogs). What to do in response to an interaction with a user, such as a user clicking a button in a card message. If unspecified, the app responds by executing an `action`—like opening a link or running a function—as normal. By specifying an `interaction`, the app can respond in special interactive ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can open a [dialog](https://developers.google.com/workspace/chat/dialogs). When specified, a loading indicator isn't shown. If specified for an add-on, the entire card is stripped and nothing is shown in the client. [Google Chat apps](https://developers.google.com/workspace/chat):
            - `persistValues` boolean — Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. To let the user make changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `NONE`. For [card messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) in Chat apps, you must also set the action's [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) to `UPDATE_MESSAGE` and use the same [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) from the card that contained the action. If `false`, the form values are cleared when the action is triggered. To prevent the user from making changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `SPINNER`.
            - `requiredWidgets` string[] — Optional. Fill this list with the names of widgets that this Action needs for a valid submission. If the widgets listed here don't have a value when this Action is invoked, the form submission is aborted. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `allWidgetsAreRequired` boolean — Optional. If this is true, then all widgets are considered required by this action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `function` string — A custom function to invoke when the containing element is clicked or otherwise activated. For example usage, see [Read form data](https://developers.google.com/workspace/chat/read-form-data).
            - `parameters` GoogleAppsCardV1ActionParameter[] — List of action parameters.
              - …
            - `loadIndicator` 'SPINNER' | 'NONE' — Specifies the loading indicator that the action displays while making the call to the action.
  - `actionResponse` ActionResponse — Parameters that a Chat app can use to configure how its response is posted.
    - `type` 'TYPE_UNSPECIFIED' | 'NEW_MESSAGE' | 'UPDATE_MESSAGE' | 'UPDATE_USER_MESSAGE_CARDS' | 'REQUEST_CONFIG' | 'DIALOG' | 'UPDATE_WIDGET' — Input only. The type of Chat app response.
    - `url` string — Input only. URL for users to authenticate or configure. (Only for `REQUEST_CONFIG` response types.)
    - `updatedWidget` UpdatedWidget — For `selectionInput` widgets, returns autocomplete suggestions for a multiselect menu.
      - `suggestions` SelectionItems — List of widget autocomplete results.
        - `items` GoogleAppsCardV1SelectionItem[] — An array of the SelectionItem objects.
          - `startIconUri` string
          - `value` string — The value associated with this item. The client should use this as a form input value. For details about working with form inputs, see [Receive form data](https://developers.google.com/workspace/chat/read-form-data).
          - `bottomText` string — For multiselect menus, a text description or label that's displayed below the item's `text` field.
          - `selected` boolean — Whether the item is selected by default. If the selection input only accepts one value (such as for radio buttons or a dropdown menu), only set this field for one item.
          - `text` string — The text that identifies or describes the item to users.
      - `widget` string — The ID of the updated widget. The ID must match the one for the widget that triggered the update request.
    - `dialogAction` DialogAction — Contains a [dialog](https://developers.google.com/workspace/chat/dialogs) and request status code.
      - `dialog` Dialog — Wrapper around the card body of the dialog.
        - `body` GoogleAppsCardV1Card — A card interface displayed in a Google Chat message or Google Workspace add-on. Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed information, gather information from users, and guide users to take a next step. [Card builder](https://addons.gsuite.google.com/uikit/builder) To learn how to build cards, see the following documentation: * For Google Chat apps, see [Design the components of a card or dialog](https://developers.google.com/workspace/chat/design-components-card-dialog). * For Google Workspace add-ons, see [Card-based interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards). Note: You can add up to 100 widgets per card. If a section's widgets push the total count above 100, that entire section and all following sections are ignored. This limit applies to both card messages and dialogs in Google Chat apps, and to cards in Google Workspace add-ons. **Example: Card message for a Google Chat app** ![Example contact card](https://developers.google.com/workspace/chat/images/card_api_reference.png) To create the sample card message in Google Chat, use the following JSON: ``` { "cardsV2": [ { "cardId": "unique-card-id", "card": { "header": { "title": "Sasha", "subtitle": "Software Engineer", "imageUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", "imageType": "CIRCLE", "imageAltText": "Avatar for Sasha" }, "sections": [ { "header": "Contact Info", "collapsible": true, "uncollapsibleWidgetsCount": 1, "widgets": [ { "decoratedText": { "startIcon": { "knownIcon": "EMAIL" }, "text": "sasha@example.com" } }, { "decoratedText": { "startIcon": { "knownIcon": "PERSON" }, "text": "Online" } }, { "decoratedText": { "startIcon": { "knownIcon": "PHONE" }, "text": "+1 (555) 555-1234" } }, { "buttonList": { "buttons": [ { "text": "Share", "onClick": { "openLink": { "url": "https://example.com/share" } } }, { "text": "Edit", "onClick": { "action": { "function": "goToView", "parameters": [ { "key": "viewType", "value": "EDIT" } ] } } } ] } } ] } ] } } ] } ```
          - `header` GoogleAppsCardV1CardHeader — Represents a card header. For an example in Google Chat apps, see [Add a header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `title` string — Required. The title of the card header. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
            - `subtitle` string — The subtitle of the card header. If specified, appears on its own line below the `title`.
            - `imageType` 'SQUARE' | 'CIRCLE' — The shape used to crop the image. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `imageUrl` string — The HTTPS URL of the image in the card header.
            - `imageAltText` string — The alternative text of this image that's used for accessibility.
          - `sections` GoogleAppsCardV1Section[] — Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see [Define a section of a card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
            - `collapsible` boolean — Indicates whether this section is collapsible. Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking **Show more**. Users can hide the widgets again by clicking **Show less**. To determine which widgets are hidden, specify `uncollapsibleWidgetsCount`.
            - `uncollapsibleWidgetsCount` integer — The number of uncollapsible widgets which remain visible even when a section is collapsed. For example, when a section contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`, the first two widgets are always shown and the last three are collapsed by default. The `uncollapsibleWidgetsCount` is taken into account only when `collapsible` is `true`.
            - `collapseControl` GoogleAppsCardV1CollapseControl — Represent an expand and collapse control. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `widgets` GoogleAppsCardV1Widget[] — All the widgets in the section. Must contain at least one widget.
              - …
            - `header` string — Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
            - `id` string — A unique ID assigned to the section that's used to identify the section to be mutated. The ID has a character limit of 64 characters and should be in the format of `[a-zA-Z0-9-]+`. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
          - `name` string — Name of the card. Used as a card identifier in card navigation. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
          - `fixedFooter` GoogleAppsCardV1CardFixedFooter — A persistent (sticky) footer that that appears at the bottom of the card. Setting `fixedFooter` without specifying a `primaryButton` or a `secondaryButton` causes an error. For Chat apps, you can use fixed footers in [dialogs](https://developers.google.com/workspace/chat/dialogs), but not [card messages](https://developers.google.com/workspace/chat/create-messages#create). For an example in Google Chat apps, see [Add a persistent footer](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `secondaryButton` GoogleAppsCardV1Button — A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). To make an image a clickable button, specify an `Image` (not an `ImageComponent`) and set an `onClick` action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `primaryButton` GoogleAppsCardV1Button — A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). To make an image a clickable button, specify an `Image` (not an `ImageComponent`) and set an `onClick` action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
          - `expressionData` GoogleAppsCardV1ExpressionData[] — The expression data for the card. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
            - `id` string — The unique identifier of the ExpressionData.
            - `expression` string — The uncompiled expression.
            - `conditions` GoogleAppsCardV1Condition[] — The list of conditions that are determined by the expression evaluation result.
              - …
            - `eventActions` GoogleAppsCardV1EventAction[] — The list of actions that the ExpressionData can be used.
              - …
          - `sectionDividerStyle` 'DIVIDER_STYLE_UNSPECIFIED' | 'SOLID_DIVIDER' | 'NO_DIVIDER' — The divider style between the header, sections and footer.
          - `cardActions` GoogleAppsCardV1CardAction[] — The card's actions. Actions are added to the card's toolbar menu. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons): For example, the following JSON constructs a card action menu with `Settings` and `Send Feedback` options: ``` "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] ```
            - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `actionLabel` string — The label that displays as the action menu item.
          - `displayStyle` 'DISPLAY_STYLE_UNSPECIFIED' | 'PEEK' | 'REPLACE' — In Google Workspace add-ons, sets the display properties of the `peekCardHeader`. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
          - `peekCardHeader` GoogleAppsCardV1CardHeader — Represents a card header. For an example in Google Chat apps, see [Add a header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `title` string — Required. The title of the card header. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
            - `subtitle` string — The subtitle of the card header. If specified, appears on its own line below the `title`.
            - `imageType` 'SQUARE' | 'CIRCLE' — The shape used to crop the image. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `imageUrl` string — The HTTPS URL of the image in the card header.
            - `imageAltText` string — The alternative text of this image that's used for accessibility.
      - `actionStatus` ActionStatus — Represents the status for a request to either invoke or submit a [dialog](https://developers.google.com/workspace/chat/dialogs).
        - `statusCode` 'OK' | 'CANCELLED' | 'UNKNOWN' | 'INVALID_ARGUMENT' | 'DEADLINE_EXCEEDED' | 'NOT_FOUND' | 'ALREADY_EXISTS' | 'PERMISSION_DENIED' | 'UNAUTHENTICATED' | 'RESOURCE_EXHAUSTED' | 'FAILED_PRECONDITION' | 'ABORTED' | 'OUT_OF_RANGE' | 'UNIMPLEMENTED' | 'INTERNAL' | 'UNAVAILABLE' | 'DATA_LOSS' — The status code.
        - `userFacingMessage` string — The message to send users about the status of their request. If unset, a generic message based on the `status_code` is sent.
  - `emojiReactionSummaries` EmojiReactionSummary[] — Output only. The list of emoji reaction summaries on the message.
    - `reactionCount` integer — Output only. The total number of reactions using the associated emoji.
    - `emoji` Emoji — An emoji that is used as a reaction to a message.
      - `customEmoji` CustomEmoji — Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
        - `uid` string — Output only. Unique key for the custom emoji resource.
        - `temporaryImageUri` string — Output only. A temporary image URL for the custom emoji, valid for at least 10 minutes. Note that this is not populated in the response when the custom emoji is created.
        - `name` string — Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
        - `emojiName` string — Optional. Immutable. User-provided name for the custom emoji, which is unique within the organization. Required when the custom emoji is created, output only otherwise. Emoji names must start and end with colons, must be lowercase and can only contain alphanumeric characters, hyphens, and underscores. Hyphens and underscores should be used to separate words and cannot be used consecutively. Example: `:valid-emoji-name:`
        - `payload` CustomEmojiPayload — Payload data for the custom emoji.
          - `fileContent` string, byte — Required. Input only. The image used for the custom emoji. The payload must be under 256 KB and the dimension of the image must be square and between 64 and 500 pixels. The restrictions are subject to change.
          - `filename` string — Required. Input only. The image file name. Supported file extensions: `.png`, `.jpg`, `.gif`.
      - `unicode` string — Optional. A basic emoji represented by a unicode string.
  - `annotations` Annotation[] — Output only. Annotations can be associated with the plain-text body of the message or with chips that link to Google Workspace resources like Google Docs or Sheets with `start_index` and `length` of 0.
    - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI' — The type of this annotation.
    - `richLinkMetadata` RichLinkMetadata — A rich link to a resource. Rich links can be associated with the plain-text body of the message or represent chips that link to Google Workspace resources like Google Docs or Sheets with `start_index` and `length` of 0.
      - `meetSpaceLinkData` MeetSpaceLinkData — Data for Meet space links.
        - `type` 'TYPE_UNSPECIFIED' | 'MEETING' | 'HUDDLE' — Indicates the type of the Meet space.
        - `huddleStatus` 'HUDDLE_STATUS_UNSPECIFIED' | 'STARTED' | 'ENDED' | 'MISSED' — Optional. Output only. If the Meet is a Huddle, indicates the status of the huddle. Otherwise, this is unset.
        - `meetingCode` string — Meeting code of the linked Meet space.
      - `uri` string — The URI of this link.
      - `driveLinkData` DriveLinkData — Data for Google Drive links.
        - `driveDataRef` DriveDataRef — A reference to the data of a drive attachment.
          - `driveFileId` string — The ID for the drive file. Use with the Drive API.
        - `mimeType` string — The mime type of the linked Google Drive resource.
      - `calendarEventLinkData` CalendarEventLinkData — Data for Calendar event links.
        - `calendarId` string — The [Calendar identifier](https://developers.google.com/workspace/calendar/api/v3/reference/calendars) of the linked Calendar.
        - `eventId` string — The [Event identifier](https://developers.google.com/workspace/calendar/api/v3/reference/events) of the linked Calendar event.
      - `chatSpaceLinkData` ChatSpaceLinkData — Data for Chat space links.
        - `space` string — The space of the linked Chat space resource. Format: `spaces/{space}`
        - `thread` string — The thread of the linked Chat space resource. Format: `spaces/{space}/threads/{thread}`
        - `message` string — The message of the linked Chat space resource. Format: `spaces/{space}/messages/{message}`
      - `richLinkType` 'RICH_LINK_TYPE_UNSPECIFIED' | 'DRIVE_FILE' | 'CHAT_SPACE' | 'GMAIL_MESSAGE' | 'MEET_SPACE' | 'CALENDAR_EVENT' — The rich link type.
    - `customEmojiMetadata` CustomEmojiMetadata — Annotation metadata for custom emoji.
      - `customEmoji` CustomEmoji — Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
        - `uid` string — Output only. Unique key for the custom emoji resource.
        - `temporaryImageUri` string — Output only. A temporary image URL for the custom emoji, valid for at least 10 minutes. Note that this is not populated in the response when the custom emoji is created.
        - `name` string — Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
        - `emojiName` string — Optional. Immutable. User-provided name for the custom emoji, which is unique within the organization. Required when the custom emoji is created, output only otherwise. Emoji names must start and end with colons, must be lowercase and can only contain alphanumeric characters, hyphens, and underscores. Hyphens and underscores should be used to separate words and cannot be used consecutively. Example: `:valid-emoji-name:`
        - `payload` CustomEmojiPayload — Payload data for the custom emoji.
          - `fileContent` string, byte — Required. Input only. The image used for the custom emoji. The payload must be under 256 KB and the dimension of the image must be square and between 64 and 500 pixels. The restrictions are subject to change.
          - `filename` string — Required. Input only. The image file name. Supported file extensions: `.png`, `.jpg`, `.gif`.
    - `slashCommand` SlashCommandMetadata — Annotation metadata for slash commands (/).
      - `triggersDialog` boolean — Indicates whether the slash command is for a dialog.
      - `commandId` string, int64 — The command ID of the invoked slash command.
      - `bot` User — A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`.
        - `isAnonymous` boolean — Output only. When `true`, the user is deleted or their profile is not visible.
        - `name` string — Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
        - `type` 'TYPE_UNSPECIFIED' | 'HUMAN' | 'BOT' — User type.
        - `displayName` string — Output only. The user's display name.
        - `domainId` string — Unique identifier of the user's Google Workspace domain.
      - `commandName` string — The name of the invoked slash command.
      - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'INVOKE' — The type of slash command.
    - `startIndex` integer — Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
    - `length` integer — Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
    - `userMention` UserMentionMetadata — Annotation metadata for user mentions (@).
      - `user` User — A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`.
        - `isAnonymous` boolean — Output only. When `true`, the user is deleted or their profile is not visible.
        - `name` string — Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
        - `type` 'TYPE_UNSPECIFIED' | 'HUMAN' | 'BOT' — User type.
        - `displayName` string — Output only. The user's display name.
        - `domainId` string — Unique identifier of the user's Google Workspace domain.
      - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'MENTION' — The type of user mention.
  - `slashCommand` SlashCommand — Metadata about a [slash command](https://developers.google.com/workspace/chat/commands) in Google Chat.
    - `commandId` string, int64 — The ID of the slash command.
  - `matchedUrl` MatchedUrl — A matched URL in a Chat message. Chat apps can preview matched URLs. For more information, see [Preview links](https://developers.google.com/chat/how-tos/preview-links).
    - `url` string — Output only. The URL that was matched.
  - `thread` Thread — A thread in a Google Chat space. For example usage, see [Start or reply to a message thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). If you specify a thread when creating a message, you can set the [`messageReplyOption`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#messagereplyoption) field to determine what happens if no matching thread is found.
    - `name` string — Identifier. Resource name of the thread. Example: `spaces/{space}/threads/{thread}`
    - `threadKey` string — Optional. Input for creating or updating a thread. Otherwise, output only. ID for the thread. Supports up to 4000 characters. This ID is unique to the Chat app that sets it. For example, if multiple Chat apps create a message using the same thread key, the messages are posted in different threads. To reply in a thread created by a person or another Chat app, specify the thread `name` field instead.
  - `text` string — Optional. Plain-text body of the message. The first link to an image, video, or web page generates a [preview chip](https://developers.google.com/workspace/chat/preview-links). You can also [@mention a Google Chat user](https://developers.google.com/workspace/chat/format-messages#messages-@mention), or everyone in the space. To learn about creating text messages, see [Send a message](https://developers.google.com/workspace/chat/create-messages).
  - `quotedMessageMetadata` QuotedMessageMetadata — Information about a message that another message quotes. When you update a message, you can't add or replace the `quotedMessageMetadata` field, but you can remove it. For example usage, see [Quote another message](https://developers.google.com/workspace/chat/create-messages#quote-a-message).
    - `quoteType` 'QUOTE_TYPE_UNSPECIFIED' | 'REPLY' | 'FORWARD' — Optional. Specifies the quote type. If not set, defaults to REPLY in the message read/write path for backward compatibility.
    - `quotedMessageSnapshot` QuotedMessageSnapshot — Provides a snapshot of the content of the quoted message at the time of quoting or forwarding
      - `text` string — Output only. Snapshot of the quoted message's text content.
      - `annotations` Annotation[] — Output only. Annotations parsed from the text body of the quoted message. Populated only for FORWARD quote type.
        - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI' — The type of this annotation.
        - `richLinkMetadata` RichLinkMetadata — A rich link to a resource. Rich links can be associated with the plain-text body of the message or represent chips that link to Google Workspace resources like Google Docs or Sheets with `start_index` and `length` of 0.
          - `meetSpaceLinkData` MeetSpaceLinkData — Data for Meet space links.
            - `type` 'TYPE_UNSPECIFIED' | 'MEETING' | 'HUDDLE' — Indicates the type of the Meet space.
            - `huddleStatus` 'HUDDLE_STATUS_UNSPECIFIED' | 'STARTED' | 'ENDED' | 'MISSED' — Optional. Output only. If the Meet is a Huddle, indicates the status of the huddle. Otherwise, this is unset.
            - `meetingCode` string — Meeting code of the linked Meet space.
          - `uri` string — The URI of this link.
          - `driveLinkData` DriveLinkData — Data for Google Drive links.
            - `driveDataRef` DriveDataRef — A reference to the data of a drive attachment.
              - …
            - `mimeType` string — The mime type of the linked Google Drive resource.
          - `calendarEventLinkData` CalendarEventLinkData — Data for Calendar event links.
            - `calendarId` string — The [Calendar identifier](https://developers.google.com/workspace/calendar/api/v3/reference/calendars) of the linked Calendar.
            - `eventId` string — The [Event identifier](https://developers.google.com/workspace/calendar/api/v3/reference/events) of the linked Calendar event.
          - `chatSpaceLinkData` ChatSpaceLinkData — Data for Chat space links.
            - `space` string — The space of the linked Chat space resource. Format: `spaces/{space}`
            - `thread` string — The thread of the linked Chat space resource. Format: `spaces/{space}/threads/{thread}`
            - `message` string — The message of the linked Chat space resource. Format: `spaces/{space}/messages/{message}`
          - `richLinkType` 'RICH_LINK_TYPE_UNSPECIFIED' | 'DRIVE_FILE' | 'CHAT_SPACE' | 'GMAIL_MESSAGE' | 'MEET_SPACE' | 'CALENDAR_EVENT' — The rich link type.
        - `customEmojiMetadata` CustomEmojiMetadata — Annotation metadata for custom emoji.
          - `customEmoji` CustomEmoji — Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
            - `uid` string — Output only. Unique key for the custom emoji resource.
            - `temporaryImageUri` string — Output only. A temporary image URL for the custom emoji, valid for at least 10 minutes. Note that this is not populated in the response when the custom emoji is created.
            - `name` string — Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
            - `emojiName` string — Optional. Immutable. User-provided name for the custom emoji, which is unique within the organization. Required when the custom emoji is created, output only otherwise. Emoji names must start and end with colons, must be lowercase and can only contain alphanumeric characters, hyphens, and underscores. Hyphens and underscores should be used to separate words and cannot be used consecutively. Example: `:valid-emoji-name:`
            - `payload` CustomEmojiPayload — Payload data for the custom emoji.
              - …
        - `slashCommand` SlashCommandMetadata — Annotation metadata for slash commands (/).
          - `triggersDialog` boolean — Indicates whether the slash command is for a dialog.
          - `commandId` string, int64 — The command ID of the invoked slash command.
          - `bot` User — A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`.
            - `isAnonymous` boolean — Output only. When `true`, the user is deleted or their profile is not visible.
            - `name` string — Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
            - `type` 'TYPE_UNSPECIFIED' | 'HUMAN' | 'BOT' — User type.
            - `displayName` string — Output only. The user's display name.
            - `domainId` string — Unique identifier of the user's Google Workspace domain.
          - `commandName` string — The name of the invoked slash command.
          - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'INVOKE' — The type of slash command.
        - `startIndex` integer — Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
        - `length` integer — Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
        - `userMention` UserMentionMetadata — Annotation metadata for user mentions (@).
          - `user` User — A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`.
            - `isAnonymous` boolean — Output only. When `true`, the user is deleted or their profile is not visible.
            - `name` string — Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
            - `type` 'TYPE_UNSPECIFIED' | 'HUMAN' | 'BOT' — User type.
            - `displayName` string — Output only. The user's display name.
            - `domainId` string — Unique identifier of the user's Google Workspace domain.
          - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'MENTION' — The type of user mention.
      - `formattedText` string — Output only. Contains the quoted message `text` with markups added to support rich formatting like hyperlinks,custom emojis, markup, etc. Populated only for FORWARD quote type.
      - `sender` string — Output only. The quoted message's author name. Populated for both REPLY & FORWARD quote types.
      - `attachments` Attachment[] — Output only. Attachments that were part of the quoted message. These are copies of the quoted message's attachment metadata. Populated only for FORWARD quote type.
        - `driveDataRef` DriveDataRef — A reference to the data of a drive attachment.
          - `driveFileId` string — The ID for the drive file. Use with the Drive API.
        - `thumbnailUri` string — Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content.
        - `contentName` string — Output only. The original file name for the content, not the full path.
        - `name` string — Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
        - `contentType` string — Output only. The content type (MIME type) of the file.
        - `attachmentDataRef` AttachmentDataRef — A reference to the attachment data.
          - `resourceName` string — Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data.
          - `attachmentUploadToken` string — Optional. Opaque token containing a reference to an uploaded attachment. Treated by clients as an opaque string and used to create or update Chat messages with attachments.
        - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT' — Output only. The source of the attachment.
        - `downloadUri` string — Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content.
    - `lastUpdateTime` string, google-datetime — Required. The timestamp when the quoted message was created or when the quoted message was last updated. If the message was edited, use this field, `last_update_time`. If the message was never edited, use `create_time`. If `last_update_time` doesn't match the latest version of the quoted message, the request fails.
    - `name` string — Required. Resource name of the message that is quoted. Format: `spaces/{space}/messages/{message}`
    - `forwardedMetadata` ForwardedMetadata — Metadata about the source space from which a message was forwarded.
      - `spaceDisplayName` string — Output only. The display name of the source space or DM at the time of forwarding. For `SPACE`, this is the space name. For `DIRECT_MESSAGE`, this is the other participant's name (e.g., "User A"). For `GROUP_CHAT`, this is a generated name based on members' first names, limited to 5 including the creator (e.g., "User A, User B").
      - `space` string — Output only. The resource name of the source space. Format: spaces/{space}
  - `createTime` string, 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.
  - `name` string — 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](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).
  - `threadReply` boolean — 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`.
  - `privateMessageViewer` User — A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`.
    - `isAnonymous` boolean — Output only. When `true`, the user is deleted or their profile is not visible.
    - `name` string — Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
    - `type` 'TYPE_UNSPECIFIED' | 'HUMAN' | 'BOT' — User type.
    - `displayName` string — Output only. The user's display name.
    - `domainId` string — Unique identifier of the user's Google Workspace domain.
  - `deletionMetadata` DeletionMetadata — Information about a deleted message. A message is deleted when `delete_time` is set.
    - `deletionType` 'DELETION_TYPE_UNSPECIFIED' | 'CREATOR' | 'SPACE_OWNER' | 'ADMIN' | 'APP_MESSAGE_EXPIRY' | 'CREATOR_VIA_APP' | 'SPACE_OWNER_VIA_APP' | 'SPACE_MEMBER' — Indicates who deleted the message.
  - `fallbackText` string — Optional. A plain-text description of the message's cards, used when the actual cards can't be displayed—for example, mobile notifications.
  - `argumentText` string — Output only. Plain-text body of the message with all Chat app mentions stripped out.
  - `attachment` Attachment[] — Optional. User-uploaded attachment.
    - `driveDataRef` DriveDataRef — A reference to the data of a drive attachment.
      - `driveFileId` string — The ID for the drive file. Use with the Drive API.
    - `thumbnailUri` string — Output only. The thumbnail URL which should be used to preview the attachment to a human user. Chat apps shouldn't use this URL to download attachment content.
    - `contentName` string — Output only. The original file name for the content, not the full path.
    - `name` string — Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
    - `contentType` string — Output only. The content type (MIME type) of the file.
    - `attachmentDataRef` AttachmentDataRef — A reference to the attachment data.
      - `resourceName` string — Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data.
      - `attachmentUploadToken` string — Optional. Opaque token containing a reference to an uploaded attachment. Treated by clients as an opaque string and used to create or update Chat messages with attachments.
    - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT' — Output only. The source of the attachment.
    - `downloadUri` string — Output only. The download URL which should be used to allow a human user to download the attachment. Chat apps shouldn't use this URL to download attachment content.
  - `space` Space — A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.
    - `type` 'TYPE_UNSPECIFIED' | 'ROOM' | 'DM' — Output only. Deprecated: Use `space_type` instead. The type of a space.
    - `externalUserAllowed` boolean — Optional. Immutable. Whether this space permits any Google Chat user as a member. Input when creating a space in a Google Workspace organization. Omit this field when creating spaces in the following conditions: * The authenticated user uses a consumer account (unmanaged user account). By default, a space created by a consumer account permits any Google Chat user. For existing spaces, this field is output only.
    - `permissionSettings` PermissionSettings — [Permission settings](https://support.google.com/chat/answer/13340792) that you can specify when updating an existing named space. To set permission settings when creating a space, specify the `PredefinedPermissionSettings` field in your request.
      - `manageMembersAndGroups` PermissionSetting — Represents a space permission setting.
        - `membersAllowed` boolean — Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `assistantManagersAllowed` boolean — Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        - `managersAllowed` boolean — Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      - `toggleHistory` PermissionSetting — Represents a space permission setting.
        - `membersAllowed` boolean — Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `assistantManagersAllowed` boolean — Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        - `managersAllowed` boolean — Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      - `replyMessages` PermissionSetting — Represents a space permission setting.
        - `membersAllowed` boolean — Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `assistantManagersAllowed` boolean — Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        - `managersAllowed` boolean — Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      - `modifySpaceDetails` PermissionSetting — Represents a space permission setting.
        - `membersAllowed` boolean — Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `assistantManagersAllowed` boolean — Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        - `managersAllowed` boolean — Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      - `useAtMentionAll` PermissionSetting — Represents a space permission setting.
        - `membersAllowed` boolean — Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `assistantManagersAllowed` boolean — Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        - `managersAllowed` boolean — Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      - `postMessages` PermissionSetting — Represents a space permission setting.
        - `membersAllowed` boolean — Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `assistantManagersAllowed` boolean — Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        - `managersAllowed` boolean — Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      - `manageWebhooks` PermissionSetting — Represents a space permission setting.
        - `membersAllowed` boolean — Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `assistantManagersAllowed` boolean — Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        - `managersAllowed` boolean — Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
      - `manageApps` PermissionSetting — Represents a space permission setting.
        - `membersAllowed` boolean — Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `assistantManagersAllowed` boolean — Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
        - `managersAllowed` boolean — Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
    - `spaceThreadingState` 'SPACE_THREADING_STATE_UNSPECIFIED' | 'THREADED_MESSAGES' | 'GROUPED_MESSAGES' | 'UNTHREADED_MESSAGES' — Output only. The threading state in the Chat space.
    - `createTime` string, google-datetime — Optional. Immutable. For spaces created in Chat, the time the space 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 space was created in the source in order to preserve the original creation time. Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
    - `singleUserBotDm` boolean — Optional. Whether the space is a DM between a Chat app and a single human.
    - `name` string — Identifier. Resource name of the space. Format: `spaces/{space}` Where `{space}` represents the system-assigned ID for the space. You can obtain the space ID by calling the [`spaces.list()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list) method or from the space URL. For example, if the space URL is `https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`, the space ID is `AAAAAAAAA`.
    - `threaded` boolean — Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
    - `spaceDetails` SpaceDetails — Details about the space including description and rules.
      - `description` string — Optional. A description of the space. For example, describe the space's discussion topic, functional purpose, or participants. Supports up to 150 characters.
      - `guidelines` string — Optional. The space's rules, expectations, and etiquette. Supports up to 5,000 characters.
    - `importMode` boolean — Optional. Whether this space is created in `Import Mode` as part of a data migration into Google Workspace. While spaces are being imported, they aren't visible to users until the import is complete. Creating a space in `Import Mode`requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
    - `spaceType` 'SPACE_TYPE_UNSPECIFIED' | 'SPACE' | 'GROUP_CHAT' | 'DIRECT_MESSAGE' — Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage.
    - `importModeExpireTime` string, google-datetime — Output only. The time when the space will be automatically deleted by the system if it remains in import mode. Each space created in import mode must exit this mode before this expire time using `spaces.completeImport`. This field is only populated for spaces that were created with import mode.
    - `customer` string — Optional. Immutable. The customer id of the domain of the space. Required only when creating a space with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and `SpaceType` is `SPACE`, otherwise should not be set. In the format `customers/{customer}`, where `customer` is the `id` from the [Admin SDK customer resource](https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers). Private apps can also use the `customers/my_customer` alias to create the space in the same Google Workspace organization as the app. This field isn't populated for direct messages (DMs) or when the space is created by non-Google Workspace users.
    - `spaceUri` string — Output only. The URI for a user to access the space.
    - `spaceHistoryState` 'HISTORY_STATE_UNSPECIFIED' | 'HISTORY_OFF' | 'HISTORY_ON' — Optional. The message history state for messages and threads in this space.
    - `accessSettings` AccessSettings — Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space.
      - `accessState` 'ACCESS_STATE_UNSPECIFIED' | 'PRIVATE' | 'DISCOVERABLE' — Output only. Indicates the access state of the space.
      - `accessPermissionSettings` AccessPermissionSettings — Access permission settings for a space.
        - `discoverSpaceSetting` AccessPermissionSetting — An access permission setting.
          - `principals` Principal[] — Optional. Unordered list. Allowed principals for this permission.
            - `audience` Audience — A target audience in Google Chat. A target audience represents a group of users within a Google Workspace organization, defined by an administrator. Target audiences are used to configure access and visibility settings for resources, such as making a space discoverable to a specific group of users. For more details, see [Target audiences](https://support.google.com/a/answer/9934697) and [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience).
              - …
        - `joinSpaceSetting` AccessPermissionSetting — An access permission setting.
          - `principals` Principal[] — Optional. Unordered list. Allowed principals for this permission.
            - `audience` Audience — A target audience in Google Chat. A target audience represents a group of users within a Google Workspace organization, defined by an administrator. Target audiences are used to configure access and visibility settings for resources, such as making a space discoverable to a specific group of users. For more details, see [Target audiences](https://support.google.com/a/answer/9934697) and [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience).
              - …
      - `audience` string — Optional. The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover the space, join the space, and preview the messages in the space. If unset, only users or Google Groups who have been individually invited or added to the space can access it. For details, see [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience). Format: `audiences/{audience}` To use the default target audience for the Google Workspace organization, set to `audiences/default`. Reading the target audience supports: - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` scope. This field is not populated when using the `chat.bot` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). Setting the target audience requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).
    - `lastActiveTime` string, google-datetime — Output only. Timestamp of the last message in the space.
    - `membershipCount` MembershipCount — Represents the count of memberships of a space, grouped into categories.
      - `joinedDirectHumanUserCount` integer — Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.
      - `joinedGroupCount` integer — Output only. Count of all groups that have directly joined the space.
    - `displayName` string — Optional. The space's display name. Required when [creating a space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create) with a `spaceType` of `SPACE`. If you receive the error message `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. For direct messages, this field might be empty. Supports up to 128 characters.
    - `adminInstalled` boolean — Output only. For direct message (DM) spaces with a Chat app, whether the space was created by a Google Workspace administrator. Administrators can install and set up a direct message with a Chat app on behalf of users in their organization. To support admin install, your Chat app must feature direct messaging.
    - `predefinedPermissionSettings` 'PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED' | 'COLLABORATION_SPACE' | 'ANNOUNCEMENT_SPACE' — Optional. Input only. Predefined space permission settings, input only when creating a space. If the field is not set, a collaboration space is created. After you create the space, settings are populated in the `PermissionSettings` field. Setting predefined permission settings supports: - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the `chat.app.spaces` or `chat.app.spaces.create` scopes. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
  - `cards` Card[] — Deprecated: Use `cards_v2` instead. Rich, formatted, and interactive cards that you can use to display UI elements such as: formatted texts, buttons, and clickable images. Cards are normally displayed below the plain-text body of the message. `cards` and `cards_v2` can have a maximum size of 32 KB.
    - `header` CardHeader
      - `subtitle` string — The subtitle of the card header.
      - `title` string — The title must be specified. The header has a fixed height: if both a title and subtitle is specified, each takes up one line. If only the title is specified, it takes up both lines.
      - `imageStyle` 'IMAGE_STYLE_UNSPECIFIED' | 'IMAGE' | 'AVATAR' — The image's type (for example, square border or circular border).
      - `imageUrl` string — The URL of the image in the card header.
    - `cardActions` CardAction[] — The actions of this card.
      - `actionLabel` string — The label used to be displayed in the action menu item.
      - `onClick` OnClick — An `onclick` action (for example, open a link).
        - `action` FormAction — A form action describes the behavior when the form is submitted. For example, you can invoke Apps Script to handle the form.
          - `actionMethodName` string — The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the Chat app as part of the card click event. You can use the same method name for several elements that trigger a common behavior.
          - `parameters` ActionParameter[] — List of action parameters.
            - `key` string — The name of the parameter for the action script.
            - `value` string — The value of the parameter.
        - `openLink` OpenLink — A link that opens a new window.
          - `url` string — The URL to open.
    - `sections` Section[] — Sections are separated by a line divider.
      - `header` string — The header of the section. Formatted text is supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
      - `widgets` WidgetMarkup[] — A section must contain at least one widget.
        - `textParagraph` TextParagraph — A paragraph of text. Formatted text supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
          - `text` string
        - `keyValue` KeyValue — A UI element contains a key (label) and a value (content). This element can also contain some actions such as `onclick` button.
          - `icon` 'ICON_UNSPECIFIED' | 'AIRPLANE' | 'BOOKMARK' | 'BUS' | 'CAR' | 'CLOCK' | 'CONFIRMATION_NUMBER_ICON' | 'DOLLAR' | 'DESCRIPTION' | 'EMAIL' | 'EVENT_PERFORMER' | 'EVENT_SEAT' | 'FLIGHT_ARRIVAL' | 'FLIGHT_DEPARTURE' | 'HOTEL' | 'HOTEL_ROOM_TYPE' | 'INVITE' | 'MAP_PIN' | 'MEMBERSHIP' | 'MULTIPLE_PEOPLE' | 'OFFER' | 'PERSON' | 'PHONE' | 'RESTAURANT_ICON' | 'SHOPPING_CART' | 'STAR' | 'STORE' | 'TICKET' | 'TRAIN' | 'VIDEO_CAMERA' | 'VIDEO_PLAY' — An enum value that's replaced by the Chat API with the corresponding icon image.
          - `contentMultiline` boolean — If the content should be multiline.
          - `bottomLabel` string — The text of the bottom label. Formatted text supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
          - `onClick` OnClick — An `onclick` action (for example, open a link).
            - `action` FormAction — A form action describes the behavior when the form is submitted. For example, you can invoke Apps Script to handle the form.
              - …
            - `openLink` OpenLink — A link that opens a new window.
              - …
          - `iconUrl` string — The icon specified by a URL.
          - `topLabel` string — The text of the top label. Formatted text supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
          - `content` string — The text of the content. Formatted text supported and always required. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
          - `button` Button — A button. Can be a text button or an image button.
            - `textButton` TextButton — A button with text and `onclick` action.
              - …
            - `imageButton` ImageButton — An image button with an `onclick` action.
              - …
        - `buttons` Button[] — A list of buttons. Buttons is also `oneof data` and only one of these fields should be set.
          - `textButton` TextButton — A button with text and `onclick` action.
            - `text` string — The text of the button.
            - `onClick` OnClick — An `onclick` action (for example, open a link).
              - …
          - `imageButton` ImageButton — An image button with an `onclick` action.
            - `icon` 'ICON_UNSPECIFIED' | 'AIRPLANE' | 'BOOKMARK' | 'BUS' | 'CAR' | 'CLOCK' | 'CONFIRMATION_NUMBER_ICON' | 'DOLLAR' | 'DESCRIPTION' | 'EMAIL' | 'EVENT_PERFORMER' | 'EVENT_SEAT' | 'FLIGHT_ARRIVAL' | 'FLIGHT_DEPARTURE' | 'HOTEL' | 'HOTEL_ROOM_TYPE' | 'INVITE' | 'MAP_PIN' | 'MEMBERSHIP' | 'MULTIPLE_PEOPLE' | 'OFFER' | 'PERSON' | 'PHONE' | 'RESTAURANT_ICON' | 'SHOPPING_CART' | 'STAR' | 'STORE' | 'TICKET' | 'TRAIN' | 'VIDEO_CAMERA' | 'VIDEO_PLAY' — The icon specified by an `enum` that indices to an icon provided by Chat API.
            - `iconUrl` string — The icon specified by a URL.
            - `name` string — The name of this `image_button` that's used for accessibility. Default value is provided if this name isn't specified.
            - `onClick` OnClick — An `onclick` action (for example, open a link).
              - …
        - `image` Image — An image that's specified by a URL and can have an `onclick` action.
          - `imageUrl` string — The URL of the image.
          - `onClick` OnClick — An `onclick` action (for example, open a link).
            - `action` FormAction — A form action describes the behavior when the form is submitted. For example, you can invoke Apps Script to handle the form.
              - …
            - `openLink` OpenLink — A link that opens a new window.
              - …
          - `aspectRatio` number, double — The aspect ratio of this image (width and height). This field lets you reserve the right height for the image while waiting for it to load. It's not meant to override the built-in aspect ratio of the image. If unset, the server fills it by prefetching the image.
    - `name` string — Name of the card.
  - `formattedText` string — 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](https://developers.google.com/workspace/chat/format-messages) for bold, italic, strikethrough, monospace, monospace block, bulleted list, and block quote. * [User mentions](https://developers.google.com/workspace/chat/format-messages#messages-@mention) 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](https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message)
  - `cardsV2` CardWithId[] — Optional. An array of [cards](https://developers.google.com/workspace/chat/api/reference/rest/v1/cards). Chat apps can create cards with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). As part of the [Developer Preview Program](https://developers.google.com/workspace/preview), if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), it can create card messages. If your Chat app is not part of Developer Preview Program, it can't create cards with user authentication. To learn how to create a message that contains cards, see [Send a message](https://developers.google.com/workspace/chat/create-messages). [Card builder](https://addons.gsuite.google.com/uikit/builder)
    - `cardId` string — Required if the message contains multiple cards. A unique identifier for a card in a message.
    - `card` GoogleAppsCardV1Card — A card interface displayed in a Google Chat message or Google Workspace add-on. Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed information, gather information from users, and guide users to take a next step. [Card builder](https://addons.gsuite.google.com/uikit/builder) To learn how to build cards, see the following documentation: * For Google Chat apps, see [Design the components of a card or dialog](https://developers.google.com/workspace/chat/design-components-card-dialog). * For Google Workspace add-ons, see [Card-based interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards). Note: You can add up to 100 widgets per card. If a section's widgets push the total count above 100, that entire section and all following sections are ignored. This limit applies to both card messages and dialogs in Google Chat apps, and to cards in Google Workspace add-ons. **Example: Card message for a Google Chat app** ![Example contact card](https://developers.google.com/workspace/chat/images/card_api_reference.png) To create the sample card message in Google Chat, use the following JSON: ``` { "cardsV2": [ { "cardId": "unique-card-id", "card": { "header": { "title": "Sasha", "subtitle": "Software Engineer", "imageUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", "imageType": "CIRCLE", "imageAltText": "Avatar for Sasha" }, "sections": [ { "header": "Contact Info", "collapsible": true, "uncollapsibleWidgetsCount": 1, "widgets": [ { "decoratedText": { "startIcon": { "knownIcon": "EMAIL" }, "text": "sasha@example.com" } }, { "decoratedText": { "startIcon": { "knownIcon": "PERSON" }, "text": "Online" } }, { "decoratedText": { "startIcon": { "knownIcon": "PHONE" }, "text": "+1 (555) 555-1234" } }, { "buttonList": { "buttons": [ { "text": "Share", "onClick": { "openLink": { "url": "https://example.com/share" } } }, { "text": "Edit", "onClick": { "action": { "function": "goToView", "parameters": [ { "key": "viewType", "value": "EDIT" } ] } } } ] } } ] } ] } } ] } ```
      - `header` GoogleAppsCardV1CardHeader — Represents a card header. For an example in Google Chat apps, see [Add a header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
        - `title` string — Required. The title of the card header. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
        - `subtitle` string — The subtitle of the card header. If specified, appears on its own line below the `title`.
        - `imageType` 'SQUARE' | 'CIRCLE' — The shape used to crop the image. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
        - `imageUrl` string — The HTTPS URL of the image in the card header.
        - `imageAltText` string — The alternative text of this image that's used for accessibility.
      - `sections` GoogleAppsCardV1Section[] — Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see [Define a section of a card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
        - `collapsible` boolean — Indicates whether this section is collapsible. Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking **Show more**. Users can hide the widgets again by clicking **Show less**. To determine which widgets are hidden, specify `uncollapsibleWidgetsCount`.
        - `uncollapsibleWidgetsCount` integer — The number of uncollapsible widgets which remain visible even when a section is collapsed. For example, when a section contains five widgets and the `uncollapsibleWidgetsCount` is set to `2`, the first two widgets are always shown and the last three are collapsed by default. The `uncollapsibleWidgetsCount` is taken into account only when `collapsible` is `true`.
        - `collapseControl` GoogleAppsCardV1CollapseControl — Represent an expand and collapse control. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
          - `horizontalAlignment` 'HORIZONTAL_ALIGNMENT_UNSPECIFIED' | 'START' | 'CENTER' | 'END' — The horizontal alignment of the expand and collapse button.
          - `expandButton` GoogleAppsCardV1Button — A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). To make an image a clickable button, specify an `Image` (not an `ImageComponent`) and set an `onClick` action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `icon` GoogleAppsCardV1Icon — An icon displayed in a widget on a card. For an example in Google Chat apps, see [Add an icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). Supports [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) and [custom](https://developers.google.com/workspace/chat/format-messages#customicons) icons. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `altText` string — The alternative text that's used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat".
            - `disabled` boolean — If `true`, the button is displayed in an inactive state and doesn't respond to user actions.
            - `color` Color — Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...
              - …
            - `type` 'TYPE_UNSPECIFIED' | 'OUTLINED' | 'FILLED' | 'FILLED_TONAL' | 'BORDERLESS' — Optional. The type of a button. If unset, button type defaults to `OUTLINED`. If the `color` field is set, the button type is forced to `FILLED` and any value set for this field is ignored.
            - `text` string — The text displayed inside the button.
            - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
          - `collapseButton` GoogleAppsCardV1Button — A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). To make an image a clickable button, specify an `Image` (not an `ImageComponent`) and set an `onClick` action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `icon` GoogleAppsCardV1Icon — An icon displayed in a widget on a card. For an example in Google Chat apps, see [Add an icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). Supports [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) and [custom](https://developers.google.com/workspace/chat/format-messages#customicons) icons. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `altText` string — The alternative text that's used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat".
            - `disabled` boolean — If `true`, the button is displayed in an inactive state and doesn't respond to user actions.
            - `color` Color — Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...
              - …
            - `type` 'TYPE_UNSPECIFIED' | 'OUTLINED' | 'FILLED' | 'FILLED_TONAL' | 'BORDERLESS' — Optional. The type of a button. If unset, button type defaults to `OUTLINED`. If the `color` field is set, the button type is forced to `FILLED` and any value set for this field is ignored.
            - `text` string — The text displayed inside the button.
            - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
        - `widgets` GoogleAppsCardV1Widget[] — All the widgets in the section. Must contain at least one widget.
          - `selectionInput` GoogleAppsCardV1SelectionInput — A widget that creates one or more UI items that users can select. Supports form submission validation for `dropdown` and `multiselect` menus only. When `Action.all_widgets_are_required` is set to `true` or this widget is specified in `Action.required_widgets`, the submission action is blocked unless a value is selected. For example, a dropdown menu or checkboxes. You can use this widget to collect data that can be predicted or enumerated. For an example in Google Chat apps, see [Add selectable UI elements](/workspace/chat/design-interactive-card-dialog#add_selectable_ui_elements). Chat apps can process the value of items that users select or input. For details about working with form inputs, see [Receive form data](https://developers.google.com/workspace/chat/read-form-data). To collect undefined or abstract data from users, use the TextInput widget. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `multiSelectMinQueryLength` integer — For multiselect menus, the number of text characters that a user inputs before the menu returns suggested selection items. If unset, the multiselect menu uses the following default values: * If the menu uses a static array of `SelectionInput` items, defaults to 0 characters and immediately populates items from the array. * If the menu uses a dynamic data source (`multi_select_data_source`), defaults to 3 characters before querying the data source to return suggested items.
            - `name` string — Required. The name that identifies the selection input in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/workspace/chat/read-form-data).
            - `multiSelectMaxSelectedItems` integer — For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items.
            - `externalDataSource` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `onChangeAction` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `platformDataSource` GoogleAppsCardV1PlatformDataSource — For a `SelectionInput` widget that uses a multiselect menu, a data source from Google Workspace. Used to populate items in a multiselect menu. [Google Chat apps](https://developers.google.com/workspace/chat):
              - …
            - `items` GoogleAppsCardV1SelectionItem[] — An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items.
              - …
            - `type` 'CHECK_BOX' | 'RADIO_BUTTON' | 'SWITCH' | 'DROPDOWN' | 'MULTI_SELECT' — The type of items that are displayed to users in a `SelectionInput` widget. Selection types support different types of interactions. For example, users can select one or more checkboxes, but they can only select one value from a dropdown menu.
            - `label` string — The text that appears above the selection input field in the user interface. Specify text that helps the user enter the information your app needs. For example, if users are selecting the urgency of a work ticket from a drop-down menu, the label might be "Urgency" or "Select urgency".
            - `hintText` string — Optional. Text that appears below the selection input field meant to assist users by prompting them to enter a certain value. This text is always visible. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
            - `dataSourceConfigs` GoogleAppsCardV1DataSourceConfig[] — Optional. The data source configs for the selection control. This field provides more fine-grained control over the data source. If specified, the `multi_select_max_selected_items` field, `multi_select_min_query_length` field, `external_data_source` field and `platform_data_source` field are ignored. Available for Google Workspace add-ons that extend Google Workspace Studio. Available for the `Dropdown widget` in Google Chat apps. For the `Dropdown` widget in Google Chat apps, only one `DataSourceConfig` is supported. If multiple `DataSourceConfig`s are set, only the first one is used.
              - …
          - `carousel` GoogleAppsCardV1Carousel — A carousel, also known as a slider, rotates and displays a list of widgets in a slideshow format, with buttons navigating to the previous or next widget. For example, this is a JSON representation of a carousel that contains three text paragraph widgets. ``` { "carouselCards": [ { "widgets": [ { "textParagraph": { "text": "First text paragraph in carousel", } } ] }, { "widgets": [ { "textParagraph": { "text": "Second text paragraph in carousel", } } ] }, { "widgets": [ { "textParagraph": { "text": "Third text paragraph in carousel", } } ] } ] } ``` [Google Chat apps](https://developers.google.com/workspace/chat):
            - `carouselCards` GoogleAppsCardV1CarouselCard[] — A list of cards included in the carousel.
              - …
          - `dateTimePicker` GoogleAppsCardV1DateTimePicker — Lets users input a date, a time, or both a date and a time. Supports form submission validation. When `Action.all_widgets_are_required` is set to `true` or this widget is specified in `Action.required_widgets`, the submission action is blocked unless a value is selected. For an example in Google Chat apps, see [Let a user pick a date and time](https://developers.google.com/workspace/chat/design-interactive-card-dialog#let_a_user_pick_a_date_and_time). Users can input text or use the picker to select dates and times. If users input an invalid date or time, the picker shows an error that prompts users to input the information correctly. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `valueMsEpoch` string, int64 — The default value displayed in the widget, in milliseconds since [Unix epoch time](https://en.wikipedia.org/wiki/Unix_time). Specify the value based on the type of picker (`DateTimePickerType`): * `DATE_AND_TIME`: a calendar date and time in UTC. For example, to represent January 1, 2023 at 12:00 PM UTC, use `1672574400000`. * `DATE_ONLY`: a calendar date at 00:00:00 UTC. For example, to represent January 1, 2023, use `1672531200000`. * `TIME_ONLY`: a time in UTC. For example, to represent 12:00 PM, use `43200000` (or `12 * 60 * 60 * 1000`).
            - `name` string — The name by which the `DateTimePicker` is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/workspace/chat/read-form-data).
            - `type` 'DATE_AND_TIME' | 'DATE_ONLY' | 'TIME_ONLY' — Whether the widget supports inputting a date, a time, or the date and time.
            - `hostAppDataSource` HostAppDataSourceMarkup — A data source from a Google Workspace application. The data source populates available items for a widget.
              - …
            - `label` string — The text that prompts users to input a date, a time, or a date and time. For example, if users are scheduling an appointment, use a label such as `Appointment date` or `Appointment date and time`.
            - `onChangeAction` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `timezoneOffsetDate` integer — The number representing the time zone offset from UTC, in minutes. If set, the `value_ms_epoch` is displayed in the specified time zone. If unset, the value defaults to the user's time zone setting.
          - `eventActions` GoogleAppsCardV1EventAction[] — Specifies the event actions that can be performed on the widget. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
            - `postEventTriggers` GoogleAppsCardV1Trigger[] — The list of triggers that will be triggered after the EventAction is executed.
              - …
            - `commonWidgetAction` GoogleAppsCardV1CommonWidgetAction — Represents an action that is not specific to a widget. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
              - …
            - `actionRuleId` string — The unique identifier of the ActionRule.
          - `image` GoogleAppsCardV1Image — An image that is specified by a URL and can have an `onClick` action. For an example, see [Add an image](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_image). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `imageUrl` string — The HTTPS URL that hosts the image. For example: ``` https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png ```
            - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `altText` string — The alternative text of this image that's used for accessibility.
          - `textInput` GoogleAppsCardV1TextInput — A field in which users can enter text. Supports suggestions and on-change actions. Supports form submission validation. When `Action.all_widgets_are_required` is set to `true` or this widget is specified in `Action.required_widgets`, the submission action is blocked unless a value is entered. For an example in Google Chat apps, see [Add a field in which a user can enter text](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_field_in_which_a_user_can_enter_text). Chat apps receive and can process the value of entered text during form input events. For details about working with form inputs, see [Receive form data](https://developers.google.com/workspace/chat/read-form-data). When you need to collect undefined or abstract data from users, use a text input. To collect defined or enumerated data from users, use the SelectionInput widget. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `initialSuggestions` GoogleAppsCardV1Suggestions — Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed. For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing `Jav`, the list of suggestions filters to show `Java` and `JavaScript`. Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter `javascript` and others `java script`. Suggesting `JavaScript` can standardize how users interact with your app. When specified, `TextInput.type` is always `SINGLE_LINE`, even if it's set to `MULTIPLE_LINE`. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `onChangeAction` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `autoCompleteAction` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `name` string — The name by which the text input is identified in a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/workspace/chat/read-form-data).
            - `value` string — The value entered by a user, returned as part of a form input event. For details about working with form inputs, see [Receive form data](https://developers.google.com/workspace/chat/read-form-data).
            - `validation` GoogleAppsCardV1Validation — Represents the necessary data for validating the widget it's attached to. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `placeholderText` string — Text that appears in the text input field when the field is empty. Use this text to prompt users to enter a value. For example, `Enter a number from 0 to 100`. [Google Chat apps](https://developers.google.com/workspace/chat):
            - `label` string — The text that appears above the text input field in the user interface. Specify text that helps the user enter the information your app needs. For example, if you are asking someone's name, but specifically need their surname, write `surname` instead of `name`. Required if `hintText` is unspecified. Otherwise, optional.
            - `hintText` string — Text that appears below the text input field meant to assist users by prompting them to enter a certain value. This text is always visible. Required if `label` is unspecified. Otherwise, optional.
            - `hostAppDataSource` HostAppDataSourceMarkup — A data source from a Google Workspace application. The data source populates available items for a widget.
              - …
            - `type` 'SINGLE_LINE' | 'MULTIPLE_LINE' — How a text input field appears in the user interface. For example, whether the field is single or multi-line.
          - `divider` GoogleAppsCardV1Divider — Displays a divider between widgets as a horizontal line. For an example in Google Chat apps, see [Add a horizontal divider between widgets](https://developers.google.com/workspace/chat/format-structure-card-dialog#add_a_horizontal_divider_between_widgets). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend): For example, the following JSON creates a divider: ``` "divider": {} ```
          - `id` string — A unique ID assigned to the widget that's used to identify the widget to be mutated. The ID has a character limit of 64 characters and should be in the format of `[a-zA-Z0-9-]+`. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
          - `horizontalAlignment` 'HORIZONTAL_ALIGNMENT_UNSPECIFIED' | 'START' | 'CENTER' | 'END' — Specifies whether widgets align to the left, right, or center of a column.
          - `chipList` GoogleAppsCardV1ChipList — A list of chips layed out horizontally, which can either scroll horizontally or wrap to the next line. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `chips` GoogleAppsCardV1Chip[] — An array of chips.
              - …
            - `layout` 'LAYOUT_UNSPECIFIED' | 'WRAPPED' | 'HORIZONTAL_SCROLLABLE' — Specified chip list layout.
          - `decoratedText` GoogleAppsCardV1DecoratedText — A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget, or a button after the text. For an example in Google Chat apps, see [Display text with decorative text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#display_text_with_decorative_elements). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `button` GoogleAppsCardV1Button — A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). To make an image a clickable button, specify an `Image` (not an `ImageComponent`) and set an `onClick` action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `bottomLabel` string — The text that appears below `text`. Always wraps.
            - `switchControl` GoogleAppsCardV1SwitchControl — Either a toggle-style switch or a checkbox inside a `decoratedText` widget. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend): Only supported in the `decoratedText` widget.
              - …
            - `icon` GoogleAppsCardV1Icon — An icon displayed in a widget on a card. For an example in Google Chat apps, see [Add an icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). Supports [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) and [custom](https://developers.google.com/workspace/chat/format-messages#customicons) icons. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `text` string — Required. The primary text. Supports simple formatting. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
            - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `contentText` GoogleAppsCardV1TextParagraph — A paragraph of text that supports formatting. For an example in Google Chat apps, see [Add a paragraph of formatted text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_a_paragraph_of_formatted_text). For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `bottomLabelText` GoogleAppsCardV1TextParagraph — A paragraph of text that supports formatting. For an example in Google Chat apps, see [Add a paragraph of formatted text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_a_paragraph_of_formatted_text). For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `topLabel` string — The text that appears above `text`. Always truncates.
            - `wrapText` boolean — The wrap text setting. If `true`, the text wraps and displays on multiple lines. Otherwise, the text is truncated. Only applies to `text`, not `topLabel` and `bottomLabel`.
            - `startIcon` GoogleAppsCardV1Icon — An icon displayed in a widget on a card. For an example in Google Chat apps, see [Add an icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). Supports [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) and [custom](https://developers.google.com/workspace/chat/format-messages#customicons) icons. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `topLabelText` GoogleAppsCardV1TextParagraph — A paragraph of text that supports formatting. For an example in Google Chat apps, see [Add a paragraph of formatted text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_a_paragraph_of_formatted_text). For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `startIconVerticalAlignment` 'VERTICAL_ALIGNMENT_UNSPECIFIED' | 'TOP' | 'MIDDLE' | 'BOTTOM' — Optional. Vertical alignment of the start icon. If not set, the icon will be vertically centered. [Google Chat apps](https://developers.google.com/workspace/chat):
            - `endIcon` GoogleAppsCardV1Icon — An icon displayed in a widget on a card. For an example in Google Chat apps, see [Add an icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). Supports [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) and [custom](https://developers.google.com/workspace/chat/format-messages#customicons) icons. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
          - `buttonList` GoogleAppsCardV1ButtonList — A list of buttons layed out horizontally. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `buttons` GoogleAppsCardV1Button[] — An array of buttons.
              - …
          - `textParagraph` GoogleAppsCardV1TextParagraph — A paragraph of text that supports formatting. For an example in Google Chat apps, see [Add a paragraph of formatted text](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_a_paragraph_of_formatted_text). For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `text` string — The text that's shown in the widget.
            - `maxLines` integer — The maximum number of lines of text that are displayed in the widget. If the text exceeds the specified maximum number of lines, the excess content is concealed behind a **show more** button. If the text is equal or shorter than the specified maximum number of lines, a **show more** button isn't displayed. The default value is 0, in which case all context is displayed. Negative values are ignored.
            - `textSyntax` 'TEXT_SYNTAX_UNSPECIFIED' | 'HTML' | 'MARKDOWN' — The syntax of the text. If not set, the text is rendered as HTML. [Google Chat apps](https://developers.google.com/workspace/chat):
          - `columns` GoogleAppsCardV1Columns — The `Columns` widget displays up to 2 columns in a card or dialog. You can add widgets to each column; the widgets appear in the order that they are specified. For an example in Google Chat apps, see [Display cards and dialogs in columns](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_cards_and_dialogs_in_columns). The height of each column is determined by the taller column. For example, if the first column is taller than the second column, both columns have the height of the first column. Because each column can contain a different number of widgets, you can't define rows or align widgets between the columns. Columns are displayed side-by-side. You can customize the width of each column using the `HorizontalSizeStyle` field. If the user's screen width is too narrow, the second column wraps below the first: * On web, the second column wraps if the screen width is less than or equal to 480 pixels. * On iOS devices, the second column wraps if the screen width is less than or equal to 300 pt. * On Android devices, the second column wraps if the screen width is less than or equal to 320 dp. To include more than two columns, or to use rows, use the `Grid` widget. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend): The add-on UIs that support columns include: * The dialog displayed when users open the add-on from an email draft. * The dialog displayed when users open the add-on from the **Add attachment** menu in a Google Calendar event.
            - `columnItems` GoogleAppsCardV1Column[] — An array of columns. You can include up to 2 columns in a card or dialog.
              - …
          - `grid` GoogleAppsCardV1Grid — Displays a grid with a collection of items. Items can only include text or images. For responsive columns, or to include more than text or images, use `Columns`. For an example in Google Chat apps, see [Display a Grid with a collection of items](https://developers.google.com/workspace/chat/format-structure-card-dialog#display_a_grid_with_a_collection_of_items). A grid supports any number of columns and items. The number of rows is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend): For example, the following JSON creates a 2 column grid with a single item: ``` "grid": { "title": "A fine collection of items", "columnCount": 2, "borderStyle": { "type": "STROKE", "cornerRadius": 4 }, "items": [ { "image": { "imageUri": "https://www.example.com/image.png", "cropStyle": { "type": "SQUARE" }, "borderStyle": { "type": "STROKE" } }, "title": "An item", "textAlignment": "CENTER" } ], "onClick": { "openLink": { "url": "https://www.example.com" } } } ```
            - `items` GoogleAppsCardV1GridItem[] — The items to display in the grid.
              - …
            - `borderStyle` GoogleAppsCardV1BorderStyle — The style options for the border of a card or widget, including the border type and color. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `title` string — The text that displays in the grid header.
            - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `columnCount` integer — The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion).
          - `visibility` 'VISIBILITY_UNSPECIFIED' | 'VISIBLE' | 'HIDDEN' — Specifies whether the widget is visible or hidden. The default value is `VISIBLE`. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
        - `header` string — Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).
        - `id` string — A unique ID assigned to the section that's used to identify the section to be mutated. The ID has a character limit of 64 characters and should be in the format of `[a-zA-Z0-9-]+`. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
      - `name` string — Name of the card. Used as a card identifier in card navigation. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
      - `fixedFooter` GoogleAppsCardV1CardFixedFooter — A persistent (sticky) footer that that appears at the bottom of the card. Setting `fixedFooter` without specifying a `primaryButton` or a `secondaryButton` causes an error. For Chat apps, you can use fixed footers in [dialogs](https://developers.google.com/workspace/chat/dialogs), but not [card messages](https://developers.google.com/workspace/chat/create-messages#create). For an example in Google Chat apps, see [Add a persistent footer](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_persistent_footer). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
        - `secondaryButton` GoogleAppsCardV1Button — A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). To make an image a clickable button, specify an `Image` (not an `ImageComponent`) and set an `onClick` action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
          - `icon` GoogleAppsCardV1Icon — An icon displayed in a widget on a card. For an example in Google Chat apps, see [Add an icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). Supports [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) and [custom](https://developers.google.com/workspace/chat/format-messages#customicons) icons. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `knownIcon` string — Display one of the built-in icons provided by Google Workspace. For example, to display an airplane icon, specify `AIRPLANE`. For a bus, specify `BUS`. For a full list of supported icons, see [built-in icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
            - `iconUrl` string — Display a custom icon hosted at an HTTPS URL. For example: ``` "iconUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png" ``` Supported file types include `.png` and `.jpg`.
            - `materialIcon` GoogleAppsCardV1MaterialIcon — A [Google Material Icon](https://fonts.google.com/icons), which includes over 2500+ options. For example, to display a [checkbox icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048) with customized weight and grade, write the following: ``` { "name": "check_box", "fill": true, "weight": 300, "grade": -25 } ``` [Google Chat apps](https://developers.google.com/workspace/chat):
              - …
            - `imageType` 'SQUARE' | 'CIRCLE' — The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a built-in icon.
            - `altText` string — Optional. A description of the icon used for accessibility. If unspecified, the default value `Button` is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, `A user's account portrait`, or `Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat`. If the icon is set in a `Button`, the `altText` appears as helper text when the user hovers over the button. However, if the button also sets `text`, the icon's `altText` is ignored.
          - `altText` string — The alternative text that's used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat".
          - `disabled` boolean — If `true`, the button is displayed in an inactive state and doesn't respond to user actions.
          - `color` Color — Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...
            - `green` number, float — The amount of green in the color as a value in the interval [0, 1].
            - `red` number, float — The amount of red in the color as a value in the interval [0, 1].
            - `blue` number, float — The amount of blue in the color as a value in the interval [0, 1].
            - `alpha` number, float — The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
          - `type` 'TYPE_UNSPECIFIED' | 'OUTLINED' | 'FILLED' | 'FILLED_TONAL' | 'BORDERLESS' — Optional. The type of a button. If unset, button type defaults to `OUTLINED`. If the `color` field is set, the button type is forced to `FILLED` and any value set for this field is ignored.
          - `text` string — The text displayed inside the button.
          - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `openLink` GoogleAppsCardV1OpenLink — Represents an `onClick` event that opens a hyperlink. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `card` GoogleAppsCardV1Card — recursive
            - `overflowMenu` GoogleAppsCardV1OverflowMenu — A widget that presents a pop-up menu with one or more actions that users can invoke. For example, showing non-primary actions in a card. You can use this widget when actions don't fit in the available space. To use, specify this widget in the `OnClick` action of widgets that support it. For example, in a `Button`. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `action` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `openDynamicLinkAction` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
        - `primaryButton` GoogleAppsCardV1Button — A text, icon, or text and icon button that users can click. For an example in Google Chat apps, see [Add a button](https://developers.google.com/workspace/chat/design-interactive-card-dialog#add_a_button). To make an image a clickable button, specify an `Image` (not an `ImageComponent`) and set an `onClick` action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
          - `icon` GoogleAppsCardV1Icon — An icon displayed in a widget on a card. For an example in Google Chat apps, see [Add an icon](https://developers.google.com/workspace/chat/add-text-image-card-dialog#add_an_icon). Supports [built-in](https://developers.google.com/workspace/chat/format-messages#builtinicons) and [custom](https://developers.google.com/workspace/chat/format-messages#customicons) icons. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `knownIcon` string — Display one of the built-in icons provided by Google Workspace. For example, to display an airplane icon, specify `AIRPLANE`. For a bus, specify `BUS`. For a full list of supported icons, see [built-in icons](https://developers.google.com/workspace/chat/format-messages#builtinicons).
            - `iconUrl` string — Display a custom icon hosted at an HTTPS URL. For example: ``` "iconUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png" ``` Supported file types include `.png` and `.jpg`.
            - `materialIcon` GoogleAppsCardV1MaterialIcon — A [Google Material Icon](https://fonts.google.com/icons), which includes over 2500+ options. For example, to display a [checkbox icon](https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck_box%3AFILL%400%3Bwght%40400%3BGRAD%400%3Bopsz%4048) with customized weight and grade, write the following: ``` { "name": "check_box", "fill": true, "weight": 300, "grade": -25 } ``` [Google Chat apps](https://developers.google.com/workspace/chat):
              - …
            - `imageType` 'SQUARE' | 'CIRCLE' — The crop style applied to the image. In some cases, applying a `CIRCLE` crop causes the image to be drawn larger than a built-in icon.
            - `altText` string — Optional. A description of the icon used for accessibility. If unspecified, the default value `Button` is provided. As a best practice, you should set a helpful description for what the icon displays, and if applicable, what it does. For example, `A user's account portrait`, or `Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat`. If the icon is set in a `Button`, the `altText` appears as helper text when the user hovers over the button. However, if the button also sets `text`, the icon's `altText` is ignored.
          - `altText` string — The alternative text that's used for accessibility. Set descriptive text that lets users know what the button does. For example, if a button opens a hyperlink, you might write: "Opens a new browser tab and navigates to the Google Chat developer documentation at https://developers.google.com/workspace/chat".
          - `disabled` boolean — If `true`, the button is displayed in an inactive state and doesn't respond to user actions.
          - `color` Color — Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most `1e-5`. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha <= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!('alpha' in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(','); return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red << 16) | (green << 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = ['#']; for (var i = 0; i < missingZeros; i++) { resultBuilder.push('0'); } resultBuilder.push(hexString); return resultBuilder.join(''); }; // ...
            - `green` number, float — The amount of green in the color as a value in the interval [0, 1].
            - `red` number, float — The amount of red in the color as a value in the interval [0, 1].
            - `blue` number, float — The amount of blue in the color as a value in the interval [0, 1].
            - `alpha` number, float — The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
          - `type` 'TYPE_UNSPECIFIED' | 'OUTLINED' | 'FILLED' | 'FILLED_TONAL' | 'BORDERLESS' — Optional. The type of a button. If unset, button type defaults to `OUTLINED`. If the `color` field is set, the button type is forced to `FILLED` and any value set for this field is ignored.
          - `text` string — The text displayed inside the button.
          - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `openLink` GoogleAppsCardV1OpenLink — Represents an `onClick` event that opens a hyperlink. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `card` GoogleAppsCardV1Card — recursive
            - `overflowMenu` GoogleAppsCardV1OverflowMenu — A widget that presents a pop-up menu with one or more actions that users can invoke. For example, showing non-primary actions in a card. You can use this widget when actions don't fit in the available space. To use, specify this widget in the `OnClick` action of widgets that support it. For example, in a `Button`. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `action` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `openDynamicLinkAction` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
      - `expressionData` GoogleAppsCardV1ExpressionData[] — The expression data for the card. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
        - `id` string — The unique identifier of the ExpressionData.
        - `expression` string — The uncompiled expression.
        - `conditions` GoogleAppsCardV1Condition[] — The list of conditions that are determined by the expression evaluation result.
          - `actionRuleId` string — The unique identifier of the ActionRule.
          - `expressionDataCondition` GoogleAppsCardV1ExpressionDataCondition — Represents a condition that is evaluated using CEL. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
            - `conditionType` 'CONDITION_TYPE_UNSPECIFIED' | 'EXPRESSION_EVALUATION_SUCCESS' | 'EXPRESSION_EVALUATION_FAILURE' — The type of the condition.
        - `eventActions` GoogleAppsCardV1EventAction[] — The list of actions that the ExpressionData can be used.
          - `postEventTriggers` GoogleAppsCardV1Trigger[] — The list of triggers that will be triggered after the EventAction is executed.
            - `actionRuleId` string — The unique identifier of the ActionRule.
          - `commonWidgetAction` GoogleAppsCardV1CommonWidgetAction — Represents an action that is not specific to a widget. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
            - `updateVisibilityAction` GoogleAppsCardV1UpdateVisibilityAction — Represents an action that updates the visibility of a widget. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
              - …
          - `actionRuleId` string — The unique identifier of the ActionRule.
      - `sectionDividerStyle` 'DIVIDER_STYLE_UNSPECIFIED' | 'SOLID_DIVIDER' | 'NO_DIVIDER' — The divider style between the header, sections and footer.
      - `cardActions` GoogleAppsCardV1CardAction[] — The card's actions. Actions are added to the card's toolbar menu. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons): For example, the following JSON constructs a card action menu with `Settings` and `Send Feedback` options: ``` "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] ```
        - `onClick` GoogleAppsCardV1OnClick — Represents how to respond when users click an interactive element on a card, such as a button. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
          - `openLink` GoogleAppsCardV1OpenLink — Represents an `onClick` event that opens a hyperlink. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `url` string — The URL to open. HTTP URLs are converted to HTTPS.
            - `openAs` 'FULL_SIZE' | 'OVERLAY' — How to open a link. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
            - `onClose` 'NOTHING' | 'RELOAD' — Whether the client forgets about a link after opening it, or observes it until the window closes. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
          - `card` GoogleAppsCardV1Card — recursive
          - `overflowMenu` GoogleAppsCardV1OverflowMenu — A widget that presents a pop-up menu with one or more actions that users can invoke. For example, showing non-primary actions in a card. You can use this widget when actions don't fit in the available space. To use, specify this widget in the `OnClick` action of widgets that support it. For example, in a `Button`. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `items` GoogleAppsCardV1OverflowMenuItem[] — Required. The list of menu options.
              - …
          - `action` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `interaction` 'INTERACTION_UNSPECIFIED' | 'OPEN_DIALOG' — Optional. Required when opening a [dialog](https://developers.google.com/workspace/chat/dialogs). What to do in response to an interaction with a user, such as a user clicking a button in a card message. If unspecified, the app responds by executing an `action`—like opening a link or running a function—as normal. By specifying an `interaction`, the app can respond in special interactive ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can open a [dialog](https://developers.google.com/workspace/chat/dialogs). When specified, a loading indicator isn't shown. If specified for an add-on, the entire card is stripped and nothing is shown in the client. [Google Chat apps](https://developers.google.com/workspace/chat):
            - `persistValues` boolean — Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. To let the user make changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `NONE`. For [card messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) in Chat apps, you must also set the action's [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) to `UPDATE_MESSAGE` and use the same [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) from the card that contained the action. If `false`, the form values are cleared when the action is triggered. To prevent the user from making changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `SPINNER`.
            - `requiredWidgets` string[] — Optional. Fill this list with the names of widgets that this Action needs for a valid submission. If the widgets listed here don't have a value when this Action is invoked, the form submission is aborted. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `allWidgetsAreRequired` boolean — Optional. If this is true, then all widgets are considered required by this action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `function` string — A custom function to invoke when the containing element is clicked or otherwise activated. For example usage, see [Read form data](https://developers.google.com/workspace/chat/read-form-data).
            - `parameters` GoogleAppsCardV1ActionParameter[] — List of action parameters.
              - …
            - `loadIndicator` 'SPINNER' | 'NONE' — Specifies the loading indicator that the action displays while making the call to the action.
          - `openDynamicLinkAction` GoogleAppsCardV1Action — An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `interaction` 'INTERACTION_UNSPECIFIED' | 'OPEN_DIALOG' — Optional. Required when opening a [dialog](https://developers.google.com/workspace/chat/dialogs). What to do in response to an interaction with a user, such as a user clicking a button in a card message. If unspecified, the app responds by executing an `action`—like opening a link or running a function—as normal. By specifying an `interaction`, the app can respond in special interactive ways. For example, by setting `interaction` to `OPEN_DIALOG`, the app can open a [dialog](https://developers.google.com/workspace/chat/dialogs). When specified, a loading indicator isn't shown. If specified for an add-on, the entire card is stripped and nothing is shown in the client. [Google Chat apps](https://developers.google.com/workspace/chat):
            - `persistValues` boolean — Indicates whether form values persist after the action. The default value is `false`. If `true`, form values remain after the action is triggered. To let the user make changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `NONE`. For [card messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create) in Chat apps, you must also set the action's [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype) to `UPDATE_MESSAGE` and use the same [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId) from the card that contained the action. If `false`, the form values are cleared when the action is triggered. To prevent the user from making changes while the action is being processed, set [`LoadIndicator`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator) to `SPINNER`.
            - `requiredWidgets` string[] — Optional. Fill this list with the names of widgets that this Action needs for a valid submission. If the widgets listed here don't have a value when this Action is invoked, the form submission is aborted. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `allWidgetsAreRequired` boolean — Optional. If this is true, then all widgets are considered required by this action. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
            - `function` string — A custom function to invoke when the containing element is clicked or otherwise activated. For example usage, see [Read form data](https://developers.google.com/workspace/chat/read-form-data).
            - `parameters` GoogleAppsCardV1ActionParameter[] — List of action parameters.
              - …
            - `loadIndicator` 'SPINNER' | 'NONE' — Specifies the loading indicator that the action displays while making the call to the action.
        - `actionLabel` string — The label that displays as the action menu item.
      - `displayStyle` 'DISPLAY_STYLE_UNSPECIFIED' | 'PEEK' | 'REPLACE' — In Google Workspace add-ons, sets the display properties of the `peekCardHeader`. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons):
      - `peekCardHeader` GoogleAppsCardV1CardHeader — Represents a card header. For an example in Google Chat apps, see [Add a header](https://developers.google.com/workspace/chat/design-components-card-dialog#add_a_header). [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
        - `title` string — Required. The title of the card header. The header has a fixed height: if both a title and subtitle are specified, each takes up one line. If only the title is specified, it takes up both lines.
        - `subtitle` string — The subtitle of the card header. If specified, appears on its own line below the `title`.
        - `imageType` 'SQUARE' | 'CIRCLE' — The shape used to crop the image. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
        - `imageUrl` string — The HTTPS URL of the image in the card header.
        - `imageAltText` string — The alternative text of this image that's used for accessibility.
  - `sender` User — A user in Google Chat. When returned as an output from a request, if your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource only populates the user's `name` and `type`.
    - `isAnonymous` boolean — Output only. When `true`, the user is deleted or their profile is not visible.
    - `name` string — Resource name for a Google Chat user. Format: `users/{user}`. `users/app` can be used as an alias for the calling app bot user. For human users, `{user}` is the same user identifier as: - the `id` for the [Person](https://developers.google.com/people/api/rest/v1/people) in the People API. For example, `users/123456789` in Chat API represents the same person as the `123456789` Person profile ID in People API. - the `id` for a [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Admin SDK Directory API. - the user's email address can be used as an alias for `{user}` in API requests. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can use `users/user@example.com` as an alias to reference `users/123456789`. Only the canonical resource name (for example `users/123456789`) will be returned from the API.
    - `type` 'TYPE_UNSPECIFIED' | 'HUMAN' | 'BOT' — User type.
    - `displayName` string — Output only. The user's display name.
    - `domainId` string — Unique identifier of the user's Google Workspace domain.
  - `attachedGifs` AttachedGif[] — Output only. GIF images that are attached to the message.
    - `uri` string — Output only. The URL that hosts the GIF image.
  - `lastUpdateTime` string, 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.
  - `silent` boolean — Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/chat.md) · [All operations](https://skmtc.net/google/apis/chat/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/chat/versions/a57a778f1fcb/schema)
