- [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#SCHEMA_REPRESENTATION)
- [CommonEventObject](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#CommonEventObject)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#CommonEventObject.SCHEMA_REPRESENTATION)
- [TimeZone](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#TimeZone)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#TimeZone.SCHEMA_REPRESENTATION)
- [Inputs](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#Inputs)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#Inputs.SCHEMA_REPRESENTATION)
- [StringInputs](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#StringInputs)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#StringInputs.SCHEMA_REPRESENTATION)
- [DateTimeInput](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#DateTimeInput)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#DateTimeInput.SCHEMA_REPRESENTATION)
- [DateInput](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#DateInput)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#DateInput.SCHEMA_REPRESENTATION)
- [TimeInput](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#TimeInput)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#TimeInput.SCHEMA_REPRESENTATION)
- [AppCommandMetadata](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#AppCommandMetadata)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#AppCommandMetadata.SCHEMA_REPRESENTATION)
- [SystemCommandMetadata](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#SystemCommandMetadata)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#SystemCommandMetadata.SCHEMA_REPRESENTATION)
- [CancelStream](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#CancelStream)
  - [JSON representation](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#CancelStream.SCHEMA_REPRESENTATION)

A Google Chat app interaction event that represents and contains data about a user's interaction with a Chat app. To configure your Chat app to receive interaction events, see [Receive and respond to user interactions](https://developers.google.com/workspace/chat/receive-respond-interactions).

In addition to receiving events from user interactions, Chat apps can receive events about changes to spaces, such as when a new member is added to a space. To learn about space events, see [Work with events from Google Chat](https://developers.google.com/workspace/chat/events-overview).

Warning: This event object is only used for [Chat apps that aren't add-ons](https://developers.google.com/workspace/chat/receive-respond-interactions#not-add-on-interaction-events). If your Chat app is built as a [Google Workspace add-on](https://developers.google.com/workspace/add-ons/chat/build), instead see [Add-on event objects](https://developers.google.com/workspace/add-ons/concepts/event-objects#chat-event-object) in the add-ons documentation. To confirm which type of event your app receives, see [Determine your event type](https://developers.google.com/workspace/chat/receive-respond-interactions#determine-event-type).

| JSON representation |
|---|
| ``` { "type": enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/EventType`), "eventTime": string, "token": string, "threadKey": string, "message": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message`) }, "user": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/User`) }, "thread": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.threads#Thread`) }, "space": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space`) }, "action": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/cards-v1#Message.FormAction`) }, "configCompleteRedirectUrl": string, "isDialogEvent": boolean, "dialogEventType": enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/DialogEventType`), "common": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#CommonEventObject`) }, "appCommandMetadata": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#AppCommandMetadata`) }, "systemCommandMetadata": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#SystemCommandMetadata`) } } ``` |

| Fields ||
|---|---|
| `type` | ``enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/EventType`)`` The [type](https://developers.google.com/workspace/chat/api/reference/rest/v1/EventType) of user interaction with the Chat app, such as `MESSAGE` or `ADDED_TO_SPACE`. |
| `eventTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The timestamp indicating when the interaction event occurred. |
| `token` | `string` A secret value that legacy Chat apps can use to verify if a request is from Google. Google randomly generates the token, and its value remains static. You can obtain, revoke, or regenerate the token from the [Chat API configuration page](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat) in the Google Cloud Console. Modern Chat apps don't use this field. It is absent from API responses and the [Chat API configuration page](https://console.cloud.google.com/apis/api/chat.googleapis.com/hangouts-chat). |
| `threadKey` | `string` The Chat app-defined key for the thread related to the interaction event. See [`spaces.messages.thread.threadKey`](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages#Thread.FIELDS.thread_key) for more information. |
| `message` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#Message`)`` For `ADDED_TO_SPACE`, `CARD_CLICKED`, and `MESSAGE` interaction events, the message that triggered the interaction event, if applicable. |
| `user` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/User`)`` The user that interacted with the Chat app. |
| `thread` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.threads#Thread`)`` The thread in which the user interacted with the Chat app. This could be in a new thread created by a newly sent message. This field is populated if the interaction event is associated with a specific message or thread. |
| `space` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space`)`` The space in which the user interacted with the Chat app. |
| `action` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/cards-v1#Message.FormAction`)`` For `CARD_CLICKED` interaction events, the form action data associated when a user clicks a card or dialog. To learn more, see [Read form data input by users on cards](https://developers.google.com/workspace/chat/read-form-data). |
| `configCompleteRedirectUrl` | `string` This URL is populated for `MESSAGE`, `ADDED_TO_SPACE`, and `APP_COMMAND` interaction events. After completing an authorization or configuration flow outside of Google Chat, users must be redirected to this URL to signal to Google Chat that the authorization or configuration flow was successful. For more information, see [Connect a Chat app with other services and tools](https://developers.google.com/workspace/chat/connect-web-services-tools). |
| `isDialogEvent` | `boolean` For `CARD_CLICKED` and `MESSAGE` interaction events, whether the user is interacting with or about to interact with a [dialog](https://developers.google.com/workspace/chat/dialogs). |
| `dialogEventType` | ``enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/DialogEventType`)`` The type of [dialog](https://developers.google.com/workspace/chat/dialogs) interaction event received. |
| `common` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#CommonEventObject`)`` Represents information about the user's client, such as locale, host app, and platform. For Chat apps, `CommonEventObject` includes information submitted by users interacting with [dialogs](https://developers.google.com/workspace/chat/dialogs), like data entered on a card. |
| `appCommandMetadata` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#AppCommandMetadata`)`` Metadata about a Chat app command. |
| `systemCommandMetadata` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#SystemCommandMetadata`)`` Metadata about a system command triggered by a user, such as cancelling an active stream message. <br /> > [!WARNING] > **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features. <br /> |

## CommonEventObject

The common event object is the portion of the overall event object that carries general, host-independent information to the add-on from the user's client. This information includes details such as the user's locale, host app, and platform.

In addition to homepage and contextual triggers, add-ons construct and pass event objects to [action callback functions](https://developers.google.com/workspace/add-ons/concepts/actions#callback_functions) when the user interacts with widgets. Your add-on's callback function can query the common event object to determine the contents of open widgets in the user's client. For example, your add-on can locate the text a user has entered into a [TextInput](https://developers.google.com/apps-script/reference/card-service/text-input) widget in the `eventObject.commentEventObject.formInputs` object.

For Chat apps, the name of the function that the user invoked when interacting with a widget.

| JSON representation |
|---|
| ``` { "userLocale": string, "hostApp": enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp`), "platform": enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Platform`), "timeZone": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#TimeZone`) }, "formInputs": { string: { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#Inputs`) }, ... }, "parameters": { string: string, ... }, "invokedFunction": string } ``` |

| Fields ||
|---|---|
| `userLocale` | `string` **Disabled by default.** The user's language and country/region identifier in the format of [ISO 639](https://wikipedia.org/wiki/ISO_639_macrolanguage) language code-[ISO 3166](https://wikipedia.org/wiki/ISO_3166) country/region code. For example, `en-US`. To turn on this field, you must set `addOns.common.useLocaleFromApp` to `true` in your add-on's manifest. Your add-on's scope list must also include `https://www.googleapis.com/auth/script.locale`. See [Accessing user locale and timezone](https://developers.google.com/workspace/add-ons/how-tos/access-user-locale) for more details. |
| `hostApp` | ``enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp`)`` Indicates the host app the add-on is active in when the event object is generated. Possible values include the following: - `GMAIL` - `CALENDAR` - `DRIVE` - `DOCS` - `SHEETS` - `SLIDES` - `CHAT` |
| `platform` | ``enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Platform`)`` The platform enum which indicates the platform where the event originates (`WEB`, `IOS`, or `ANDROID`). Not supported by Chat apps. |
| `timeZone` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#TimeZone`)`` **Disabled by default.** The timezone ID and offset from Coordinated Universal Time (UTC). To turn on this field, you must set `addOns.common.useLocaleFromApp` to `true` in your add-on's manifest. Your add-on's scope list must also include `https://www.googleapis.com/auth/script.locale`. See [Accessing user locale and timezone](https://developers.google.com/workspace/add-ons/how-tos/access-user-locale) for more details. Only supported for the event types [`CARD_CLICKED`](https://developers.google.com/chat/api/reference/rest/v1/EventType#ENUM_VALUES.CARD_CLICKED) and [`SUBMIT_DIALOG`](https://developers.google.com/chat/api/reference/rest/v1/DialogEventType#ENUM_VALUES.SUBMIT_DIALOG). |
| `formInputs` | ``map (key: string, value: object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#Inputs`))`` A map containing the current values of the widgets in the displayed card. The map keys are the string `name` values assigned to each input widget (such as `TextInput.name`, `SelectionInput.name`, `DateTimePicker.name`, or `DecoratedText.SwitchControl.name`). The structure of the map value object is dependent on the widget type: **Note** : The following examples are formatted for Apps Script's V8 runtime. If you're using Rhino runtime, you must add `[""]` after the value. For example, instead of `e.commonEventObject.formInputs.employeeName.stringInputs.value[0]`, format the event object as `e.commonEventObject.formInputs.employeeName[""].stringInputs.value[0]`. To learn more about runtimes in Apps Script, see the [V8 Runtime Overview](https://developers.google.com/apps-script/guides/v8-runtime). - Single-valued widgets (for example, a `TextInput` widget, or a `SelectionInput` widget of type `DROPDOWN` or `RADIO_BUTTON`): a `StringInputs` object containing a single-element list (or an empty list if no selection is made). **Example** : for a text input widget with `employeeName` as its `name`, access the text input value with: `e.commonEventObject.formInputs.employeeName.stringInputs.value[0]`. - Multi-valued widgets (for example, a `SelectionInput` widget of type `CHECK_BOX`, `SWITCH`, or `MULTI_SELECT`): a `StringInputs` object containing the list of selected item `value` strings. **Example** : for a multi-value widget with `participants` as its `name`, access the value array with: `e.commonEventObject.formInputs.participants.stringInputs.value`. - **A `DecoratedText.SwitchControl` widget** : a `StringInputs` object. When `selected` is `true`, `stringInputs.value` contains the switch's `value` field (or `""` if `value` was not specified; if multiple switches share the same `name`, each selected switch's `value` is included in the list). When `selected` is `false`, the switch's `value` is omitted from `stringInputs.value`. - **A date-time picker (`DateTimePickerType.DATE_AND_TIME`)** : a [`DateTimeInput object`](https://developers.google.com/workspace/add-ons/concepts/event-objects#date-time-input). **Example** : For a picker with a `name` of `myDTPicker`, access the [`DateTimeInput`](https://developers.google.com/workspace/add-ons/concepts/event-objects#date-time-input) object using `e.commonEventObject.formInputs.myDTPicker.dateTimeInput`. - **A date-only picker (`DateTimePickerType.DATE_ONLY`)** : a [`DateInput object`](https://developers.google.com/workspace/add-ons/concepts/event-objects#date-input). **Example** : For a picker with a `name` of `myDatePicker`, access the [`DateInput`](https://developers.google.com/workspace/add-ons/concepts/event-objects#date-input) object using `e.commonEventObject.formInputs.myDatePicker.dateInput`. - **A time-only picker (`DateTimePickerType.TIME_ONLY`)** : a [`TimeInput object`](https://developers.google.com/workspace/add-ons/concepts/event-objects#time-input). **Example** : For a picker with a `name` of `myTimePicker`, access the [`TimeInput`](https://developers.google.com/workspace/add-ons/concepts/event-objects#time-input) object using `e.commonEventObject.formInputs.myTimePicker.timeInput`. |
| `parameters` | `map (key: string, value: string)` Any additional parameters you supply to an action using [`actionParameters`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#google.apps.card.v1.Action.ActionParameter) or [`Action.setParameters()`](https://developers.google.com/apps-script/reference/card-service/action#setparametersparameters). **Developer Preview:** For [add-ons that extend Google Chat](https://developers.google.com/workspace/add-ons/chat), to suggest items based on what the users type in multiselect menus, use the value of the `"autocomplete_widget_query"` key (`event.commonEventObject.parameters["autocomplete_widget_query"]`). You can use this value to query a database and suggest selectable items to users as they type. For details, see [Collect and process information from Google Chat users](https://developers.google.com/workspace/add-ons/chat/collect-information). |
| `invokedFunction` | `string` Name of the function to invoke. This field doesn't populate for Google Workspace Add-ons that extend Google Chat. Instead, to receive function data like identifiers, add-ons that extend Chat should use the `parameters` field. See [Build interactive interfaces for Chat apps](https://developers.google.com/workspace/add-ons/chat/build). |

## TimeZone

The timezone ID and offset from Coordinated Universal Time (UTC). Only supported for the event types [`CARD_CLICKED`](https://developers.google.com/chat/api/reference/rest/v1/EventType#ENUM_VALUES.CARD_CLICKED) and [`SUBMIT_DIALOG`](https://developers.google.com/chat/api/reference/rest/v1/DialogEventType#ENUM_VALUES.SUBMIT_DIALOG).

| JSON representation |
|---|
| ``` { "id": string, "offset": integer } ``` |

| Fields ||
|---|---|
| `id` | `string` The [IANA TZ](https://www.iana.org/time-zones) time zone database code, such as "America/Toronto". |
| `offset` | `integer` The user timezone offset, in milliseconds, from Coordinated Universal Time (UTC). |

## Inputs

Types of data that users can [input on cards or dialogs](https://developers.google.com/chat/ui/read-form-data). The input type depends on the type of values that the widget accepts.

| JSON representation |
|---|
| ``` { "stringInputs": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#StringInputs`) }, "dateTimeInput": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#DateTimeInput`) }, "dateInput": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#DateInput`) }, "timeInput": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#TimeInput`) } } ``` |

| Fields ||
|---|---|
| The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `stringInputs` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#StringInputs`)`` A list of strings that represent the values that the user inputs in a widget. If the widget only accepts one value, such as a [`TextInput`](https://developers.google.com/chat/api/reference/rest/v1/cards#TextInput) widget, the list contains one string object. If the widget accepts multiple values, such as a [`SelectionInput`](https://developers.google.com/chat/api/reference/rest/v1/cards#selectioninput) widget of checkboxes, the list contains a string object for each value that the user inputs or selects. |
| `dateTimeInput` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#DateTimeInput`)`` Date and time input values from a [`DateTimePicker`](https://developers.google.com/chat/api/reference/rest/v1/cards#DateTimePicker) widget that accepts both a date and time. |
| `dateInput` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#DateInput`)`` Date input values from a [`DateTimePicker`](https://developers.google.com/chat/api/reference/rest/v1/cards#DateTimePicker) widget that only accepts date values. |
| `timeInput` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#TimeInput`)`` Time input values from a [`DateTimePicker`](https://developers.google.com/chat/api/reference/rest/v1/cards#DateTimePicker) widget that only accepts time values. |
| End of mutually exclusive fields. ||

## StringInputs

Input parameter for regular widgets. For single-valued widgets, it is a single value list. For multi-valued widgets, such as checkbox, all the values are presented.

| JSON representation |
|---|
| ``` { "value": [ string ] } ``` |

| Fields ||
|---|---|
| `value[]` | `string` An list of strings entered by the user. |

## DateTimeInput

Date and time input values.

| JSON representation |
|---|
| ``` { "msSinceEpoch": string, "hasDate": boolean, "hasTime": boolean } ``` |

| Fields ||
|---|---|
| `msSinceEpoch` | `string (https://developers.google.com/discovery/v1/type-format format)` Time since epoch time, in milliseconds. |
| `hasDate` | `boolean` Whether the `datetime` input includes a calendar date. |
| `hasTime` | `boolean` Whether the `datetime` input includes a timestamp. |

## DateInput

Date input values.

| JSON representation |
|---|
| ``` { "msSinceEpoch": string } ``` |

| Fields ||
|---|---|
| `msSinceEpoch` | `string (https://developers.google.com/discovery/v1/type-format format)` Time since epoch time, in milliseconds. |

## TimeInput

Time input values.

| JSON representation |
|---|
| ``` { "hours": integer, "minutes": integer } ``` |

| Fields ||
|---|---|
| `hours` | `integer` The hour on a 24-hour clock. |
| `minutes` | `integer` The number of minutes past the hour. Valid values are 0 to 59. |

## AppCommandMetadata

Metadata about a [Chat app command](https://developers.google.com/workspace/chat/commands).

| JSON representation |
|---|
| ``` { "appCommandId": integer, "appCommandType": enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/AppCommandType`) } ``` |

| Fields ||
|---|---|
| `appCommandId` | `integer` The ID for the command specified in the Chat API configuration. |
| `appCommandType` | ``enum (`https://developers.google.com/workspace/chat/api/reference/rest/v1/AppCommandType`)`` The type of Chat app command. |

## SystemCommandMetadata

Metadata about a system command that is triggered by the user.

<br />

> [!WARNING]
> **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.

<br />

| JSON representation |
|---|
| ``` { "cancelStream": { object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#CancelStream`) } } ``` |

| Fields ||
|---|---|
| The system command invoked. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `cancelStream` | ``object (`https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#CancelStream`)`` Command for cancelling an active stream message. |
| End of mutually exclusive fields. ||

## CancelStream

Command for cancelling an active stream message.

| JSON representation |
|---|
| ``` { "streamMessage": string } ``` |

| Fields ||
|---|---|
| `streamMessage` | `string` Required. The resource name of the stream message on which the cancel command was performed. Format: `spaces/{space}/streamMessages/{streamMessage}` |