---
title: "GET /v1/spaces/{spacesId}/spaceEvents/{spaceEventsId}"
method: GET
path: "/v1/spaces/{spacesId}/spaceEvents/{spaceEventsId}"
tags: ["spaces"]
---

# GET /v1/spaces/{spacesId}/spaceEvents/{spaceEventsId}

`GET /v1/spaces/{spacesId}/spaceEvents/{spaceEventsId}`

## Request

- Base URL: `https://chat.googleapis.com`
- URL: `https://chat.googleapis.com/v1/spaces/{spacesId}/spaceEvents/{spaceEventsId}`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.app.all.memberships.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.app.all.memberships.readonly`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.app.all.messages.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.app.all.messages.readonly`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.app.all.spaces.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.app.all.spaces.readonly`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.app.memberships`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.app.memberships`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.app.memberships.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.app.memberships.readonly`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.app.messages.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.app.messages.readonly`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.app.spaces`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.app.spaces`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.app.spaces.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.app.spaces.readonly`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.memberships`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.memberships`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.memberships.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.memberships.readonly`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.messages`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.messages`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.messages.reactions`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.messages.reactions`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.messages.reactions.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.messages.reactions.readonly`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.messages.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.messages.readonly`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.spaces`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.spaces`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/chat.spaces.readonly`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/chat.spaces.readonly`

Returns an event from a Google Chat space. The [event payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) contains the most recent version of the resource that changed. For example, if you request an event about a new message but the message was later updated, the server returns the updated `Message` resource in the event payload. Note: The `permissionSettings` field is not returned in the Space object of the Space event data for this request. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize) with an [authorization scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes) appropriate for reading the requested data: - [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 one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.app.spaces` - `https://www.googleapis.com/auth/chat.app.spaces.readonly` - `https://www.googleapis.com/auth/chat.app.messages.readonly` - `https://www.googleapis.com/auth/chat.app.memberships` - `https://www.googleapis.com/auth/chat.app.memberships.readonly` - [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.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces` - `https://www.googleapis.com/auth/chat.messages.readonly` - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.messages.reactions.readonly` - `https://www.googleapis.com/auth/chat.messages.reactions` - `https://www.googleapis.com/auth/chat.memberships.readonly` - `https://www.googleapis.com/auth/chat.memberships` To get an event, the authenticated caller must be a member of the space. For an example, see [Get details about an event from a Google Chat space](https://developers.google.com/workspace/chat/get-space-event).

## Path parameters

- `spacesId` string, required
- `spaceEventsId` string, required

## Response `200`

Successful response

- SpaceEvent: An event that represents a change or activity in a Google Chat space. To learn more, see [Work with events from Google Chat](https://developers.google.com/workspace/chat/events-overview).
  - `eventTime` string, google-datetime: Time when the event occurred.
  - `eventType` string: Type of space event. Each event type has a batch version, which represents multiple instances of the event type that occur in a short period of time. For `spaceEvents.list()` requests, omit batch event types in your query filter. By default, the server returns both event type and its batch version. Supported event types for [messages](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages): * New message: `google.workspace.chat.message.v1.created` * Updated message: `google.workspace.chat.message.v1.updated` * Deleted message: `google.workspace.chat.message.v1.deleted` * Multiple new messages: `google.workspace.chat.message.v1.batchCreated` * Multiple updated messages: `google.workspace.chat.message.v1.batchUpdated` * Multiple deleted messages: `google.workspace.chat.message.v1.batchDeleted` Supported event types for [memberships](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members): * New membership: `google.workspace.chat.membership.v1.created` * Updated membership: `google.workspace.chat.membership.v1.updated` * Deleted membership: `google.workspace.chat.membership.v1.deleted` * Multiple new memberships: `google.workspace.chat.membership.v1.batchCreated` * Multiple updated memberships: `google.workspace.chat.membership.v1.batchUpdated` * Multiple deleted memberships: `google.workspace.chat.membership.v1.batchDeleted` Supported event types for [reactions](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions): * New reaction: `google.workspace.chat.reaction.v1.created` * Deleted reaction: `google.workspace.chat.reaction.v1.deleted` * Multiple new reactions: `google.workspace.chat.reaction.v1.batchCreated` * Multiple deleted reactions: `google.workspace.chat.reaction.v1.batchDeleted` Supported event types about the [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces): * Updated space: `google.workspace.chat.space.v1.updated` * Multiple space updates: `google.workspace.chat.space.v1.batchUpdated`
  - `membershipBatchCreatedEventData` MembershipBatchCreatedEventData: Event payload for multiple new memberships. Event type: `google.workspace.chat.membership.v1.batchCreated`
    - `memberships` MembershipCreatedEventData[]: A list of new memberships.
      - `membership` Membership: Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.
        - `affiliation` 'AFFILIATION_UNSPECIFIED' | 'INTERNAL' | 'EXTERNAL' | 'MANAGED_EXTERNAL': Output only. A user's relationship to the Workspace organization that owns the space. In spaces owned by consumer accounts, the affiliation of all members is `EXTERNAL`.
        - `createTime` string, google-datetime: Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.
        - `deleteTime` string, google-datetime: Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.
        - `groupMember` Group: A Google Group in Google Chat.
          - `name` string: Resource name for a Google Group. Represents a [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in Cloud Identity Groups API. Format: groups/{group}
        - `member` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
        - `name` string: Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}`
        - `role` 'MEMBERSHIP_ROLE_UNSPECIFIED' | 'ROLE_MEMBER' | 'ROLE_MANAGER' | 'ROLE_ASSISTANT_MANAGER': Optional. User's role within a Chat space, which determines their permitted actions in the space. This field can only be used as input in `UpdateMembership`.
        - `state` 'MEMBERSHIP_STATE_UNSPECIFIED' | 'JOINED' | 'INVITED' | 'NOT_A_MEMBER': Output only. State of the membership.
  - `membershipBatchDeletedEventData` MembershipBatchDeletedEventData: Event payload for multiple deleted memberships. Event type: `google.workspace.chat.membership.v1.batchDeleted`
    - `memberships` MembershipDeletedEventData[]: A list of deleted memberships.
      - `membership` Membership: Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.
        - `affiliation` 'AFFILIATION_UNSPECIFIED' | 'INTERNAL' | 'EXTERNAL' | 'MANAGED_EXTERNAL': Output only. A user's relationship to the Workspace organization that owns the space. In spaces owned by consumer accounts, the affiliation of all members is `EXTERNAL`.
        - `createTime` string, google-datetime: Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.
        - `deleteTime` string, google-datetime: Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.
        - `groupMember` Group: A Google Group in Google Chat.
          - `name` string: Resource name for a Google Group. Represents a [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in Cloud Identity Groups API. Format: groups/{group}
        - `member` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
        - `name` string: Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}`
        - `role` 'MEMBERSHIP_ROLE_UNSPECIFIED' | 'ROLE_MEMBER' | 'ROLE_MANAGER' | 'ROLE_ASSISTANT_MANAGER': Optional. User's role within a Chat space, which determines their permitted actions in the space. This field can only be used as input in `UpdateMembership`.
        - `state` 'MEMBERSHIP_STATE_UNSPECIFIED' | 'JOINED' | 'INVITED' | 'NOT_A_MEMBER': Output only. State of the membership.
  - `membershipBatchUpdatedEventData` MembershipBatchUpdatedEventData: Event payload for multiple updated memberships. Event type: `google.workspace.chat.membership.v1.batchUpdated`
    - `memberships` MembershipUpdatedEventData[]: A list of updated memberships.
      - `membership` Membership: Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.
        - `affiliation` 'AFFILIATION_UNSPECIFIED' | 'INTERNAL' | 'EXTERNAL' | 'MANAGED_EXTERNAL': Output only. A user's relationship to the Workspace organization that owns the space. In spaces owned by consumer accounts, the affiliation of all members is `EXTERNAL`.
        - `createTime` string, google-datetime: Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.
        - `deleteTime` string, google-datetime: Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.
        - `groupMember` Group: A Google Group in Google Chat.
          - `name` string: Resource name for a Google Group. Represents a [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in Cloud Identity Groups API. Format: groups/{group}
        - `member` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
        - `name` string: Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}`
        - `role` 'MEMBERSHIP_ROLE_UNSPECIFIED' | 'ROLE_MEMBER' | 'ROLE_MANAGER' | 'ROLE_ASSISTANT_MANAGER': Optional. User's role within a Chat space, which determines their permitted actions in the space. This field can only be used as input in `UpdateMembership`.
        - `state` 'MEMBERSHIP_STATE_UNSPECIFIED' | 'JOINED' | 'INVITED' | 'NOT_A_MEMBER': Output only. State of the membership.
  - `membershipCreatedEventData` MembershipCreatedEventData: Event payload for a new membership. Event type: `google.workspace.chat.membership.v1.created`.
    - `membership` Membership: Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.
      - `affiliation` 'AFFILIATION_UNSPECIFIED' | 'INTERNAL' | 'EXTERNAL' | 'MANAGED_EXTERNAL': Output only. A user's relationship to the Workspace organization that owns the space. In spaces owned by consumer accounts, the affiliation of all members is `EXTERNAL`.
      - `createTime` string, google-datetime: Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.
      - `deleteTime` string, google-datetime: Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.
      - `groupMember` Group: A Google Group in Google Chat.
        - `name` string: Resource name for a Google Group. Represents a [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in Cloud Identity Groups API. Format: groups/{group}
      - `member` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
        - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `domainId` string: Unique identifier of the user's Google Workspace domain.
        - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
        - `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.
      - `name` string: Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}`
      - `role` 'MEMBERSHIP_ROLE_UNSPECIFIED' | 'ROLE_MEMBER' | 'ROLE_MANAGER' | 'ROLE_ASSISTANT_MANAGER': Optional. User's role within a Chat space, which determines their permitted actions in the space. This field can only be used as input in `UpdateMembership`.
      - `state` 'MEMBERSHIP_STATE_UNSPECIFIED' | 'JOINED' | 'INVITED' | 'NOT_A_MEMBER': Output only. State of the membership.
  - `membershipDeletedEventData` MembershipDeletedEventData: Event payload for a deleted membership. Event type: `google.workspace.chat.membership.v1.deleted`
    - `membership` Membership: Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.
      - `affiliation` 'AFFILIATION_UNSPECIFIED' | 'INTERNAL' | 'EXTERNAL' | 'MANAGED_EXTERNAL': Output only. A user's relationship to the Workspace organization that owns the space. In spaces owned by consumer accounts, the affiliation of all members is `EXTERNAL`.
      - `createTime` string, google-datetime: Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.
      - `deleteTime` string, google-datetime: Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.
      - `groupMember` Group: A Google Group in Google Chat.
        - `name` string: Resource name for a Google Group. Represents a [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in Cloud Identity Groups API. Format: groups/{group}
      - `member` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
        - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `domainId` string: Unique identifier of the user's Google Workspace domain.
        - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
        - `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.
      - `name` string: Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}`
      - `role` 'MEMBERSHIP_ROLE_UNSPECIFIED' | 'ROLE_MEMBER' | 'ROLE_MANAGER' | 'ROLE_ASSISTANT_MANAGER': Optional. User's role within a Chat space, which determines their permitted actions in the space. This field can only be used as input in `UpdateMembership`.
      - `state` 'MEMBERSHIP_STATE_UNSPECIFIED' | 'JOINED' | 'INVITED' | 'NOT_A_MEMBER': Output only. State of the membership.
  - `membershipUpdatedEventData` MembershipUpdatedEventData: Event payload for an updated membership. Event type: `google.workspace.chat.membership.v1.updated`
    - `membership` Membership: Represents a membership relation in Google Chat, such as whether a user or Chat app is invited to, part of, or absent from a space.
      - `affiliation` 'AFFILIATION_UNSPECIFIED' | 'INTERNAL' | 'EXTERNAL' | 'MANAGED_EXTERNAL': Output only. A user's relationship to the Workspace organization that owns the space. In spaces owned by consumer accounts, the affiliation of all members is `EXTERNAL`.
      - `createTime` string, google-datetime: Optional. Immutable. The creation time of the membership, such as when a member joined or was invited to join a space. This field is output only, except when used to import historical memberships in import mode spaces.
      - `deleteTime` string, google-datetime: Optional. Immutable. The deletion time of the membership, such as when a member left or was removed from a space. This field is output only, except when used to import historical memberships in import mode spaces.
      - `groupMember` Group: A Google Group in Google Chat.
        - `name` string: Resource name for a Google Group. Represents a [group](https://cloud.google.com/identity/docs/reference/rest/v1/groups) in Cloud Identity Groups API. Format: groups/{group}
      - `member` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
        - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `domainId` string: Unique identifier of the user's Google Workspace domain.
        - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
        - `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.
      - `name` string: Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}`
      - `role` 'MEMBERSHIP_ROLE_UNSPECIFIED' | 'ROLE_MEMBER' | 'ROLE_MANAGER' | 'ROLE_ASSISTANT_MANAGER': Optional. User's role within a Chat space, which determines their permitted actions in the space. This field can only be used as input in `UpdateMembership`.
      - `state` 'MEMBERSHIP_STATE_UNSPECIFIED' | 'JOINED' | 'INVITED' | 'NOT_A_MEMBER': Output only. State of the membership.
  - `messageBatchCreatedEventData` MessageBatchCreatedEventData: Event payload for multiple new messages. Event type: `google.workspace.chat.message.v1.batchCreated`
    - `messages` MessageCreatedEventData[]: A list of new messages.
      - `message` Message: A message in a Google Chat space.
        - `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.
              - …
        - `actionResponse` ActionResponse: Parameters that a Chat app can use to configure how its response is posted.
          - `dialogAction` DialogAction: Contains a [dialog](https://developers.google.com/workspace/chat/dialogs) and request status code.
            - `actionStatus` ActionStatus: Represents the status for a request to either invoke or submit a [dialog](https://developers.google.com/workspace/chat/dialogs).
              - …
            - `dialog` Dialog: Wrapper around the card body of the dialog.
              - …
          - `type` 'TYPE_UNSPECIFIED' | 'NEW_MESSAGE' | 'UPDATE_MESSAGE' | 'UPDATE_USER_MESSAGE_CARDS' | 'REQUEST_CONFIG' | 'DIALOG' | 'UPDATE_WIDGET': Input only. The type of Chat app response.
          - `updatedWidget` UpdatedWidget: For `selectionInput` widgets, returns autocomplete suggestions for a multiselect menu.
            - `suggestions` SelectionItems: List of widget autocomplete results.
              - …
            - `widget` string: The ID of the updated widget. The ID must match the one for the widget that triggered the update request.
          - `url` string: Input only. URL for users to authenticate or configure. (Only for `REQUEST_CONFIG` response types.)
        - `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.
          - `customEmojiMetadata` CustomEmojiMetadata: Annotation metadata for custom emoji.
            - `customEmoji` CustomEmoji: Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
              - …
          - `length` integer: Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
          - `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.
            - `calendarEventLinkData` CalendarEventLinkData: Data for Calendar event links.
              - …
            - `chatSpaceLinkData` ChatSpaceLinkData: Data for Chat space links.
              - …
            - `driveLinkData` DriveLinkData: Data for Google Drive links.
              - …
            - `meetSpaceLinkData` MeetSpaceLinkData: Data for Meet space links.
              - …
            - `richLinkType` 'RICH_LINK_TYPE_UNSPECIFIED' | 'DRIVE_FILE' | 'CHAT_SPACE' | 'GMAIL_MESSAGE' | 'MEET_SPACE' | 'CALENDAR_EVENT': The rich link type.
            - `uri` string: The URI of this link.
          - `slashCommand` SlashCommandMetadata: Annotation metadata for slash commands (/).
            - `bot` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
              - …
            - `commandId` string, int64: The command ID of the invoked slash command.
            - `commandName` string: The name of the invoked slash command.
            - `triggersDialog` boolean: Indicates whether the slash command is for a dialog.
            - `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.
          - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI': The type of this annotation.
          - `userMention` UserMentionMetadata: Annotation metadata for user mentions (@).
            - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'MENTION': The type of user mention.
            - `user` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
              - …
        - `argumentText` string: Output only. Plain-text body of the message with all Chat app mentions stripped out.
        - `attachedGifs` AttachedGif[]: Output only. GIF images that are attached to the message.
          - `uri` string: Output only. The URL that hosts the GIF image.
        - `attachment` Attachment[]: Optional. User-uploaded attachment.
          - `attachmentDataRef` AttachmentDataRef: A reference to 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.
            - `resourceName` string: Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data.
          - `contentName` string: Output only. The original file name for the content, not the full path.
          - `contentType` string: Output only. The content type (MIME type) of the file.
          - `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.
          - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
            - `driveFileId` string: The ID for the drive file. Use with the Drive API.
          - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
          - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
          - `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.
        - `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.
          - `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).
              - …
          - `header` CardHeader
            - `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.
            - `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.
          - `name` string: Name of the card.
          - `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.
              - …
        - `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)
          - `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" } ] } } } ] } } ] } ] } } ] } ```
            - `cardActions` GoogleAppsCardV1CardAction[]: The card's actions. Actions are added to the card's toolbar menu. Supports up to 10 `CardAction` items. [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):
            - `expressionData` GoogleAppsCardV1ExpressionData[]: The expression data for the card. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
              - …
            - `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):
              - …
            - `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):
              - …
            - `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):
            - `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):
              - …
            - `sectionDividerStyle` 'DIVIDER_STYLE_UNSPECIFIED' | 'SOLID_DIVIDER' | 'NO_DIVIDER': The divider style between the header, sections and footer.
            - `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).
              - …
          - `cardId` string: Required if the message contains multiple cards. A unique identifier for a card in a message.
          - `ownerUser` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
            - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `domainId` string: Unique identifier of the user's Google Workspace domain.
            - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
            - `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.
        - `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).
        - `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.
        - `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.
        - `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.
        - `elements` Elements: Elements are additional message components, including inline `citations` (where each citation is associated with a specific portion of the message text) and `cited_sources` (which are general references used to generate the response and are not directly linked to specific segments of the text). Both `citations` and `cited_sources` can be provided as input when creating or updating a message and are populated on output when reading a message.
          - `citations` Citation[]: Optional. A list of inline citations referenced within the message text (via `` tags) that render as interactive hover cards.
            - `citedSources` CitedSource[]: Optional. A list of sources that are relevant to the citation. Sources are displayed in the citation hover card.
              - …
            - `id` string: Required. The ID of the citation. This ID is defined by the app creating the citation and must match the `data-id` attribute of the `` tag in the message text. Must contain only ASCII letters and numbers, and less than 63 characters.
          - `citedSources` CitedSource[]: Optional. A list of sources to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.
            - `footer` Footer: A footer for a source, used for attribution.
              - …
            - `snippet` Snippet: A snippet object representing an excerpt from a larger corpus.
              - …
            - `title` string: Required. The plaintext title of the `CitedSource`. Does not support markdown format.
            - `uri` string: Required. The URI pointing to the resource referenced by this `CitedSource`.
        - `emojiReactionSummaries` EmojiReactionSummary[]: Output only. The list of emoji reaction summaries on the message.
          - `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).
              - …
            - `unicode` string: Optional. A basic emoji represented by a unicode string.
          - `reactionCount` integer: Output only. The total number of reactions using the associated emoji.
        - `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.
        - `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)
        - `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.
        - `markupSyntax` 'MARKUP_SYNTAX_UNSPECIFIED' | 'MARKUP_SYNTAX_CHAT' | 'MARKUP_SYNTAX_MARKDOWN': Optional. Specifies how the server interprets the message `text` field content when creating a message or updating the `text` field of a message. When calling `UpdateMessage`, set `markup_syntax` and `text` on the `Message` resource and include `text` (not `markup_syntax`) in `update_mask`.
        - `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.
        - `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).
        - `privateMessageViewer` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
        - `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).
          - `forwardedMetadata` ForwardedMetadata: Metadata about the source space from which a message was forwarded.
            - `space` string: Output only. The resource name of the source space. Format: spaces/{space}
            - `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").
          - `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}`
          - `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
            - `annotations` Annotation[]: Output only. Annotations parsed from the text body of the quoted message. Populated only for FORWARD quote type.
              - …
            - `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.
              - …
            - `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.
            - `text` string: Output only. Snapshot of the quoted message's text content.
        - `sender` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
        - `silent` boolean: Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.
        - `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.
        - `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.
          - `accessSettings` AccessSettings: Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space.
            - `accessPermissionSettings` AccessPermissionSettings: Access permission settings for a space.
              - …
            - `accessState` 'ACCESS_STATE_UNSPECIFIED' | 'PRIVATE' | 'DISCOVERABLE': Output only. Indicates the access state of the space.
            - `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).
          - `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.
          - `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`.
          - `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.
          - `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.
          - `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.
          - `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).
          - `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.
          - `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.
          - `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`.
          - `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.
            - `manageApps` PermissionSetting: Represents a space permission setting.
              - …
            - `manageMembersAndGroups` PermissionSetting: Represents a space permission setting.
              - …
            - `manageWebhooks` PermissionSetting: Represents a space permission setting.
              - …
            - `modifySpaceDetails` PermissionSetting: Represents a space permission setting.
              - …
            - `postMessages` PermissionSetting: Represents a space permission setting.
              - …
            - `replyMessages` PermissionSetting: Represents a space permission setting.
              - …
            - `toggleHistory` PermissionSetting: Represents a space permission setting.
              - …
            - `useAtMentionAll` PermissionSetting: Represents a space permission setting.
              - …
            - `viewSpaceMembership` PermissionSetting: Represents a space permission setting.
              - …
          - `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)
          - `singleUserBotDm` boolean: Optional. Whether the space is a DM between a Chat app and a single human.
          - `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 4,096 characters.
            - `guidelines` string: Optional. The space's rules, expectations, and etiquette. Supports up to 5,000 characters.
          - `spaceHistoryState` 'HISTORY_STATE_UNSPECIFIED' | 'HISTORY_OFF' | 'HISTORY_ON': Optional. The message history state for messages and threads in this space.
          - `spaceThreadingState` 'SPACE_THREADING_STATE_UNSPECIFIED' | 'THREADED_MESSAGES' | 'GROUPED_MESSAGES' | 'UNTHREADED_MESSAGES': Output only. The threading state in the Chat space.
          - `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.
          - `spaceUri` string: Output only. The URI for a user to access the space.
          - `threaded` boolean: Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
          - `type` 'TYPE_UNSPECIFIED' | 'ROOM' | 'DM': Output only. Deprecated: Use `space_type` instead. The type of a space.
        - `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).
        - `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.
        - `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`.
  - `messageBatchDeletedEventData` MessageBatchDeletedEventData: Event payload for multiple deleted messages. Event type: `google.workspace.chat.message.v1.batchDeleted`
    - `messages` MessageDeletedEventData[]: A list of deleted messages.
      - `message` Message: A message in a Google Chat space.
        - `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.
              - …
        - `actionResponse` ActionResponse: Parameters that a Chat app can use to configure how its response is posted.
          - `dialogAction` DialogAction: Contains a [dialog](https://developers.google.com/workspace/chat/dialogs) and request status code.
            - `actionStatus` ActionStatus: Represents the status for a request to either invoke or submit a [dialog](https://developers.google.com/workspace/chat/dialogs).
              - …
            - `dialog` Dialog: Wrapper around the card body of the dialog.
              - …
          - `type` 'TYPE_UNSPECIFIED' | 'NEW_MESSAGE' | 'UPDATE_MESSAGE' | 'UPDATE_USER_MESSAGE_CARDS' | 'REQUEST_CONFIG' | 'DIALOG' | 'UPDATE_WIDGET': Input only. The type of Chat app response.
          - `updatedWidget` UpdatedWidget: For `selectionInput` widgets, returns autocomplete suggestions for a multiselect menu.
            - `suggestions` SelectionItems: List of widget autocomplete results.
              - …
            - `widget` string: The ID of the updated widget. The ID must match the one for the widget that triggered the update request.
          - `url` string: Input only. URL for users to authenticate or configure. (Only for `REQUEST_CONFIG` response types.)
        - `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.
          - `customEmojiMetadata` CustomEmojiMetadata: Annotation metadata for custom emoji.
            - `customEmoji` CustomEmoji: Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
              - …
          - `length` integer: Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
          - `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.
            - `calendarEventLinkData` CalendarEventLinkData: Data for Calendar event links.
              - …
            - `chatSpaceLinkData` ChatSpaceLinkData: Data for Chat space links.
              - …
            - `driveLinkData` DriveLinkData: Data for Google Drive links.
              - …
            - `meetSpaceLinkData` MeetSpaceLinkData: Data for Meet space links.
              - …
            - `richLinkType` 'RICH_LINK_TYPE_UNSPECIFIED' | 'DRIVE_FILE' | 'CHAT_SPACE' | 'GMAIL_MESSAGE' | 'MEET_SPACE' | 'CALENDAR_EVENT': The rich link type.
            - `uri` string: The URI of this link.
          - `slashCommand` SlashCommandMetadata: Annotation metadata for slash commands (/).
            - `bot` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
              - …
            - `commandId` string, int64: The command ID of the invoked slash command.
            - `commandName` string: The name of the invoked slash command.
            - `triggersDialog` boolean: Indicates whether the slash command is for a dialog.
            - `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.
          - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI': The type of this annotation.
          - `userMention` UserMentionMetadata: Annotation metadata for user mentions (@).
            - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'MENTION': The type of user mention.
            - `user` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
              - …
        - `argumentText` string: Output only. Plain-text body of the message with all Chat app mentions stripped out.
        - `attachedGifs` AttachedGif[]: Output only. GIF images that are attached to the message.
          - `uri` string: Output only. The URL that hosts the GIF image.
        - `attachment` Attachment[]: Optional. User-uploaded attachment.
          - `attachmentDataRef` AttachmentDataRef: A reference to 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.
            - `resourceName` string: Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data.
          - `contentName` string: Output only. The original file name for the content, not the full path.
          - `contentType` string: Output only. The content type (MIME type) of the file.
          - `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.
          - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
            - `driveFileId` string: The ID for the drive file. Use with the Drive API.
          - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
          - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
          - `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.
        - `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.
          - `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).
              - …
          - `header` CardHeader
            - `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.
            - `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.
          - `name` string: Name of the card.
          - `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.
              - …
        - `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)
          - `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" } ] } } } ] } } ] } ] } } ] } ```
            - `cardActions` GoogleAppsCardV1CardAction[]: The card's actions. Actions are added to the card's toolbar menu. Supports up to 10 `CardAction` items. [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):
            - `expressionData` GoogleAppsCardV1ExpressionData[]: The expression data for the card. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
              - …
            - `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):
              - …
            - `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):
              - …
            - `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):
            - `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):
              - …
            - `sectionDividerStyle` 'DIVIDER_STYLE_UNSPECIFIED' | 'SOLID_DIVIDER' | 'NO_DIVIDER': The divider style between the header, sections and footer.
            - `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).
              - …
          - `cardId` string: Required if the message contains multiple cards. A unique identifier for a card in a message.
          - `ownerUser` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
            - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `domainId` string: Unique identifier of the user's Google Workspace domain.
            - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
            - `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.
        - `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).
        - `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.
        - `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.
        - `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.
        - `elements` Elements: Elements are additional message components, including inline `citations` (where each citation is associated with a specific portion of the message text) and `cited_sources` (which are general references used to generate the response and are not directly linked to specific segments of the text). Both `citations` and `cited_sources` can be provided as input when creating or updating a message and are populated on output when reading a message.
          - `citations` Citation[]: Optional. A list of inline citations referenced within the message text (via `` tags) that render as interactive hover cards.
            - `citedSources` CitedSource[]: Optional. A list of sources that are relevant to the citation. Sources are displayed in the citation hover card.
              - …
            - `id` string: Required. The ID of the citation. This ID is defined by the app creating the citation and must match the `data-id` attribute of the `` tag in the message text. Must contain only ASCII letters and numbers, and less than 63 characters.
          - `citedSources` CitedSource[]: Optional. A list of sources to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.
            - `footer` Footer: A footer for a source, used for attribution.
              - …
            - `snippet` Snippet: A snippet object representing an excerpt from a larger corpus.
              - …
            - `title` string: Required. The plaintext title of the `CitedSource`. Does not support markdown format.
            - `uri` string: Required. The URI pointing to the resource referenced by this `CitedSource`.
        - `emojiReactionSummaries` EmojiReactionSummary[]: Output only. The list of emoji reaction summaries on the message.
          - `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).
              - …
            - `unicode` string: Optional. A basic emoji represented by a unicode string.
          - `reactionCount` integer: Output only. The total number of reactions using the associated emoji.
        - `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.
        - `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)
        - `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.
        - `markupSyntax` 'MARKUP_SYNTAX_UNSPECIFIED' | 'MARKUP_SYNTAX_CHAT' | 'MARKUP_SYNTAX_MARKDOWN': Optional. Specifies how the server interprets the message `text` field content when creating a message or updating the `text` field of a message. When calling `UpdateMessage`, set `markup_syntax` and `text` on the `Message` resource and include `text` (not `markup_syntax`) in `update_mask`.
        - `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.
        - `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).
        - `privateMessageViewer` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
        - `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).
          - `forwardedMetadata` ForwardedMetadata: Metadata about the source space from which a message was forwarded.
            - `space` string: Output only. The resource name of the source space. Format: spaces/{space}
            - `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").
          - `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}`
          - `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
            - `annotations` Annotation[]: Output only. Annotations parsed from the text body of the quoted message. Populated only for FORWARD quote type.
              - …
            - `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.
              - …
            - `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.
            - `text` string: Output only. Snapshot of the quoted message's text content.
        - `sender` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
        - `silent` boolean: Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.
        - `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.
        - `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.
          - `accessSettings` AccessSettings: Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space.
            - `accessPermissionSettings` AccessPermissionSettings: Access permission settings for a space.
              - …
            - `accessState` 'ACCESS_STATE_UNSPECIFIED' | 'PRIVATE' | 'DISCOVERABLE': Output only. Indicates the access state of the space.
            - `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).
          - `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.
          - `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`.
          - `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.
          - `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.
          - `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.
          - `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).
          - `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.
          - `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.
          - `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`.
          - `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.
            - `manageApps` PermissionSetting: Represents a space permission setting.
              - …
            - `manageMembersAndGroups` PermissionSetting: Represents a space permission setting.
              - …
            - `manageWebhooks` PermissionSetting: Represents a space permission setting.
              - …
            - `modifySpaceDetails` PermissionSetting: Represents a space permission setting.
              - …
            - `postMessages` PermissionSetting: Represents a space permission setting.
              - …
            - `replyMessages` PermissionSetting: Represents a space permission setting.
              - …
            - `toggleHistory` PermissionSetting: Represents a space permission setting.
              - …
            - `useAtMentionAll` PermissionSetting: Represents a space permission setting.
              - …
            - `viewSpaceMembership` PermissionSetting: Represents a space permission setting.
              - …
          - `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)
          - `singleUserBotDm` boolean: Optional. Whether the space is a DM between a Chat app and a single human.
          - `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 4,096 characters.
            - `guidelines` string: Optional. The space's rules, expectations, and etiquette. Supports up to 5,000 characters.
          - `spaceHistoryState` 'HISTORY_STATE_UNSPECIFIED' | 'HISTORY_OFF' | 'HISTORY_ON': Optional. The message history state for messages and threads in this space.
          - `spaceThreadingState` 'SPACE_THREADING_STATE_UNSPECIFIED' | 'THREADED_MESSAGES' | 'GROUPED_MESSAGES' | 'UNTHREADED_MESSAGES': Output only. The threading state in the Chat space.
          - `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.
          - `spaceUri` string: Output only. The URI for a user to access the space.
          - `threaded` boolean: Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
          - `type` 'TYPE_UNSPECIFIED' | 'ROOM' | 'DM': Output only. Deprecated: Use `space_type` instead. The type of a space.
        - `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).
        - `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.
        - `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`.
  - `messageBatchUpdatedEventData` MessageBatchUpdatedEventData: Event payload for multiple updated messages. Event type: `google.workspace.chat.message.v1.batchUpdated`
    - `messages` MessageUpdatedEventData[]: A list of updated messages.
      - `message` Message: A message in a Google Chat space.
        - `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.
              - …
        - `actionResponse` ActionResponse: Parameters that a Chat app can use to configure how its response is posted.
          - `dialogAction` DialogAction: Contains a [dialog](https://developers.google.com/workspace/chat/dialogs) and request status code.
            - `actionStatus` ActionStatus: Represents the status for a request to either invoke or submit a [dialog](https://developers.google.com/workspace/chat/dialogs).
              - …
            - `dialog` Dialog: Wrapper around the card body of the dialog.
              - …
          - `type` 'TYPE_UNSPECIFIED' | 'NEW_MESSAGE' | 'UPDATE_MESSAGE' | 'UPDATE_USER_MESSAGE_CARDS' | 'REQUEST_CONFIG' | 'DIALOG' | 'UPDATE_WIDGET': Input only. The type of Chat app response.
          - `updatedWidget` UpdatedWidget: For `selectionInput` widgets, returns autocomplete suggestions for a multiselect menu.
            - `suggestions` SelectionItems: List of widget autocomplete results.
              - …
            - `widget` string: The ID of the updated widget. The ID must match the one for the widget that triggered the update request.
          - `url` string: Input only. URL for users to authenticate or configure. (Only for `REQUEST_CONFIG` response types.)
        - `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.
          - `customEmojiMetadata` CustomEmojiMetadata: Annotation metadata for custom emoji.
            - `customEmoji` CustomEmoji: Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
              - …
          - `length` integer: Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
          - `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.
            - `calendarEventLinkData` CalendarEventLinkData: Data for Calendar event links.
              - …
            - `chatSpaceLinkData` ChatSpaceLinkData: Data for Chat space links.
              - …
            - `driveLinkData` DriveLinkData: Data for Google Drive links.
              - …
            - `meetSpaceLinkData` MeetSpaceLinkData: Data for Meet space links.
              - …
            - `richLinkType` 'RICH_LINK_TYPE_UNSPECIFIED' | 'DRIVE_FILE' | 'CHAT_SPACE' | 'GMAIL_MESSAGE' | 'MEET_SPACE' | 'CALENDAR_EVENT': The rich link type.
            - `uri` string: The URI of this link.
          - `slashCommand` SlashCommandMetadata: Annotation metadata for slash commands (/).
            - `bot` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
              - …
            - `commandId` string, int64: The command ID of the invoked slash command.
            - `commandName` string: The name of the invoked slash command.
            - `triggersDialog` boolean: Indicates whether the slash command is for a dialog.
            - `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.
          - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI': The type of this annotation.
          - `userMention` UserMentionMetadata: Annotation metadata for user mentions (@).
            - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'MENTION': The type of user mention.
            - `user` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
              - …
        - `argumentText` string: Output only. Plain-text body of the message with all Chat app mentions stripped out.
        - `attachedGifs` AttachedGif[]: Output only. GIF images that are attached to the message.
          - `uri` string: Output only. The URL that hosts the GIF image.
        - `attachment` Attachment[]: Optional. User-uploaded attachment.
          - `attachmentDataRef` AttachmentDataRef: A reference to 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.
            - `resourceName` string: Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data.
          - `contentName` string: Output only. The original file name for the content, not the full path.
          - `contentType` string: Output only. The content type (MIME type) of the file.
          - `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.
          - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
            - `driveFileId` string: The ID for the drive file. Use with the Drive API.
          - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
          - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
          - `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.
        - `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.
          - `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).
              - …
          - `header` CardHeader
            - `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.
            - `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.
          - `name` string: Name of the card.
          - `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.
              - …
        - `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)
          - `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" } ] } } } ] } } ] } ] } } ] } ```
            - `cardActions` GoogleAppsCardV1CardAction[]: The card's actions. Actions are added to the card's toolbar menu. Supports up to 10 `CardAction` items. [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):
            - `expressionData` GoogleAppsCardV1ExpressionData[]: The expression data for the card. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
              - …
            - `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):
              - …
            - `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):
              - …
            - `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):
            - `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):
              - …
            - `sectionDividerStyle` 'DIVIDER_STYLE_UNSPECIFIED' | 'SOLID_DIVIDER' | 'NO_DIVIDER': The divider style between the header, sections and footer.
            - `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).
              - …
          - `cardId` string: Required if the message contains multiple cards. A unique identifier for a card in a message.
          - `ownerUser` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
            - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `domainId` string: Unique identifier of the user's Google Workspace domain.
            - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
            - `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.
        - `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).
        - `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.
        - `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.
        - `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.
        - `elements` Elements: Elements are additional message components, including inline `citations` (where each citation is associated with a specific portion of the message text) and `cited_sources` (which are general references used to generate the response and are not directly linked to specific segments of the text). Both `citations` and `cited_sources` can be provided as input when creating or updating a message and are populated on output when reading a message.
          - `citations` Citation[]: Optional. A list of inline citations referenced within the message text (via `` tags) that render as interactive hover cards.
            - `citedSources` CitedSource[]: Optional. A list of sources that are relevant to the citation. Sources are displayed in the citation hover card.
              - …
            - `id` string: Required. The ID of the citation. This ID is defined by the app creating the citation and must match the `data-id` attribute of the `` tag in the message text. Must contain only ASCII letters and numbers, and less than 63 characters.
          - `citedSources` CitedSource[]: Optional. A list of sources to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.
            - `footer` Footer: A footer for a source, used for attribution.
              - …
            - `snippet` Snippet: A snippet object representing an excerpt from a larger corpus.
              - …
            - `title` string: Required. The plaintext title of the `CitedSource`. Does not support markdown format.
            - `uri` string: Required. The URI pointing to the resource referenced by this `CitedSource`.
        - `emojiReactionSummaries` EmojiReactionSummary[]: Output only. The list of emoji reaction summaries on the message.
          - `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).
              - …
            - `unicode` string: Optional. A basic emoji represented by a unicode string.
          - `reactionCount` integer: Output only. The total number of reactions using the associated emoji.
        - `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.
        - `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)
        - `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.
        - `markupSyntax` 'MARKUP_SYNTAX_UNSPECIFIED' | 'MARKUP_SYNTAX_CHAT' | 'MARKUP_SYNTAX_MARKDOWN': Optional. Specifies how the server interprets the message `text` field content when creating a message or updating the `text` field of a message. When calling `UpdateMessage`, set `markup_syntax` and `text` on the `Message` resource and include `text` (not `markup_syntax`) in `update_mask`.
        - `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.
        - `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).
        - `privateMessageViewer` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
        - `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).
          - `forwardedMetadata` ForwardedMetadata: Metadata about the source space from which a message was forwarded.
            - `space` string: Output only. The resource name of the source space. Format: spaces/{space}
            - `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").
          - `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}`
          - `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
            - `annotations` Annotation[]: Output only. Annotations parsed from the text body of the quoted message. Populated only for FORWARD quote type.
              - …
            - `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.
              - …
            - `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.
            - `text` string: Output only. Snapshot of the quoted message's text content.
        - `sender` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
        - `silent` boolean: Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.
        - `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.
        - `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.
          - `accessSettings` AccessSettings: Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space.
            - `accessPermissionSettings` AccessPermissionSettings: Access permission settings for a space.
              - …
            - `accessState` 'ACCESS_STATE_UNSPECIFIED' | 'PRIVATE' | 'DISCOVERABLE': Output only. Indicates the access state of the space.
            - `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).
          - `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.
          - `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`.
          - `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.
          - `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.
          - `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.
          - `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).
          - `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.
          - `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.
          - `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`.
          - `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.
            - `manageApps` PermissionSetting: Represents a space permission setting.
              - …
            - `manageMembersAndGroups` PermissionSetting: Represents a space permission setting.
              - …
            - `manageWebhooks` PermissionSetting: Represents a space permission setting.
              - …
            - `modifySpaceDetails` PermissionSetting: Represents a space permission setting.
              - …
            - `postMessages` PermissionSetting: Represents a space permission setting.
              - …
            - `replyMessages` PermissionSetting: Represents a space permission setting.
              - …
            - `toggleHistory` PermissionSetting: Represents a space permission setting.
              - …
            - `useAtMentionAll` PermissionSetting: Represents a space permission setting.
              - …
            - `viewSpaceMembership` PermissionSetting: Represents a space permission setting.
              - …
          - `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)
          - `singleUserBotDm` boolean: Optional. Whether the space is a DM between a Chat app and a single human.
          - `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 4,096 characters.
            - `guidelines` string: Optional. The space's rules, expectations, and etiquette. Supports up to 5,000 characters.
          - `spaceHistoryState` 'HISTORY_STATE_UNSPECIFIED' | 'HISTORY_OFF' | 'HISTORY_ON': Optional. The message history state for messages and threads in this space.
          - `spaceThreadingState` 'SPACE_THREADING_STATE_UNSPECIFIED' | 'THREADED_MESSAGES' | 'GROUPED_MESSAGES' | 'UNTHREADED_MESSAGES': Output only. The threading state in the Chat space.
          - `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.
          - `spaceUri` string: Output only. The URI for a user to access the space.
          - `threaded` boolean: Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
          - `type` 'TYPE_UNSPECIFIED' | 'ROOM' | 'DM': Output only. Deprecated: Use `space_type` instead. The type of a space.
        - `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).
        - `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.
        - `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`.
  - `messageCreatedEventData` MessageCreatedEventData: Event payload for a new message. Event type: `google.workspace.chat.message.v1.created`
    - `message` Message: A message in a Google Chat space.
      - `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.
            - `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".
            - `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(''); }; // ...
              - …
            - `disabled` boolean: If `true`, the button is displayed in an inactive state and doesn't respond to user actions.
            - `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):
              - …
            - `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):
              - …
            - `text` string: The text displayed inside the button.
            - `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.
      - `actionResponse` ActionResponse: Parameters that a Chat app can use to configure how its response is posted.
        - `dialogAction` DialogAction: Contains a [dialog](https://developers.google.com/workspace/chat/dialogs) and request status code.
          - `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.
          - `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" } ] } } } ] } } ] } ] } } ] } ```
              - …
        - `type` 'TYPE_UNSPECIFIED' | 'NEW_MESSAGE' | 'UPDATE_MESSAGE' | 'UPDATE_USER_MESSAGE_CARDS' | 'REQUEST_CONFIG' | 'DIALOG' | 'UPDATE_WIDGET': Input only. The type of Chat app response.
        - `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.
              - …
          - `widget` string: The ID of the updated widget. The ID must match the one for the widget that triggered the update request.
        - `url` string: Input only. URL for users to authenticate or configure. (Only for `REQUEST_CONFIG` response types.)
      - `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.
        - `customEmojiMetadata` CustomEmojiMetadata: Annotation metadata for custom emoji.
          - `customEmoji` CustomEmoji: Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
            - `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:`
            - `name` string: Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
            - `payload` CustomEmojiPayload: Payload data for the custom emoji.
              - …
            - `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.
            - `uid` string: Output only. Unique key for the custom emoji resource.
        - `length` integer: Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
        - `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.
          - `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.
            - `message` string: The message of the linked Chat space resource. Format: `spaces/{space}/messages/{message}`
            - `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}`
          - `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.
          - `meetSpaceLinkData` MeetSpaceLinkData: Data for Meet space links.
            - `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.
            - `type` 'TYPE_UNSPECIFIED' | 'MEETING' | 'HUDDLE': Indicates the type of the Meet space.
          - `richLinkType` 'RICH_LINK_TYPE_UNSPECIFIED' | 'DRIVE_FILE' | 'CHAT_SPACE' | 'GMAIL_MESSAGE' | 'MEET_SPACE' | 'CALENDAR_EVENT': The rich link type.
          - `uri` string: The URI of this link.
        - `slashCommand` SlashCommandMetadata: Annotation metadata for slash commands (/).
          - `bot` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
            - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `domainId` string: Unique identifier of the user's Google Workspace domain.
            - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
            - `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.
          - `commandId` string, int64: The command ID of the invoked slash command.
          - `commandName` string: The name of the invoked slash command.
          - `triggersDialog` boolean: Indicates whether the slash command is for a dialog.
          - `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.
        - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI': The type of this annotation.
        - `userMention` UserMentionMetadata: Annotation metadata for user mentions (@).
          - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'MENTION': The type of user mention.
          - `user` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
            - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `domainId` string: Unique identifier of the user's Google Workspace domain.
            - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
            - `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.
      - `argumentText` string: Output only. Plain-text body of the message with all Chat app mentions stripped out.
      - `attachedGifs` AttachedGif[]: Output only. GIF images that are attached to the message.
        - `uri` string: Output only. The URL that hosts the GIF image.
      - `attachment` Attachment[]: Optional. User-uploaded attachment.
        - `attachmentDataRef` AttachmentDataRef: A reference to 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.
          - `resourceName` string: Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data.
        - `contentName` string: Output only. The original file name for the content, not the full path.
        - `contentType` string: Output only. The content type (MIME type) of the file.
        - `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.
        - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
          - `driveFileId` string: The ID for the drive file. Use with the Drive API.
        - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
        - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
        - `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.
      - `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.
        - `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.
              - …
            - `openLink` OpenLink: A link that opens a new window.
              - …
        - `header` CardHeader
          - `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.
          - `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.
        - `name` string: Name of the card.
        - `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.
            - `buttons` Button[]: A list of buttons. Buttons is also `oneof data` and only one of these fields should be set.
              - …
            - `image` Image: An image that's specified by a URL and can have an `onclick` action.
              - …
            - `keyValue` KeyValue: A UI element contains a key (label) and a value (content). This element can also contain some actions such as `onclick` button.
              - …
            - `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).
              - …
      - `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)
        - `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" } ] } } } ] } } ] } ] } } ] } ```
          - `cardActions` GoogleAppsCardV1CardAction[]: The card's actions. Actions are added to the card's toolbar menu. Supports up to 10 `CardAction` items. [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" } } } ] ```
            - `actionLabel` string: The label that displays as the action menu item.
            - `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):
              - …
          - `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):
          - `expressionData` GoogleAppsCardV1ExpressionData[]: The expression data for the card. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
            - `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.
              - …
            - `expression` string: The uncompiled expression.
            - `id` string: The unique identifier of the ExpressionData.
          - `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):
            - `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):
              - …
            - `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):
              - …
          - `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):
            - `imageAltText` string: The alternative text of this image that's used for accessibility.
            - `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.
            - `subtitle` string: The subtitle of the card header. If specified, appears on its own line below the `title`.
            - `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.
          - `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):
          - `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):
            - `imageAltText` string: The alternative text of this image that's used for accessibility.
            - `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.
            - `subtitle` string: The subtitle of the card header. If specified, appears on its own line below the `title`.
            - `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.
          - `sectionDividerStyle` 'DIVIDER_STYLE_UNSPECIFIED' | 'SOLID_DIVIDER' | 'NO_DIVIDER': The divider style between the header, sections and footer.
          - `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).
            - `collapseControl` GoogleAppsCardV1CollapseControl: Represent an expand and collapse control. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `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`.
            - `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.
            - `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`.
            - `widgets` GoogleAppsCardV1Widget[]: All the widgets in the section. Must contain at least one widget. A card supports up to 100 widgets across all sections.
              - …
        - `cardId` string: Required if the message contains multiple cards. A unique identifier for a card in a message.
        - `ownerUser` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
      - `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).
      - `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.
      - `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.
      - `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.
      - `elements` Elements: Elements are additional message components, including inline `citations` (where each citation is associated with a specific portion of the message text) and `cited_sources` (which are general references used to generate the response and are not directly linked to specific segments of the text). Both `citations` and `cited_sources` can be provided as input when creating or updating a message and are populated on output when reading a message.
        - `citations` Citation[]: Optional. A list of inline citations referenced within the message text (via `` tags) that render as interactive hover cards.
          - `citedSources` CitedSource[]: Optional. A list of sources that are relevant to the citation. Sources are displayed in the citation hover card.
            - `footer` Footer: A footer for a source, used for attribution.
              - …
            - `snippet` Snippet: A snippet object representing an excerpt from a larger corpus.
              - …
            - `title` string: Required. The plaintext title of the `CitedSource`. Does not support markdown format.
            - `uri` string: Required. The URI pointing to the resource referenced by this `CitedSource`.
          - `id` string: Required. The ID of the citation. This ID is defined by the app creating the citation and must match the `data-id` attribute of the `` tag in the message text. Must contain only ASCII letters and numbers, and less than 63 characters.
        - `citedSources` CitedSource[]: Optional. A list of sources to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.
          - `footer` Footer: A footer for a source, used for attribution.
            - `text` string: Optional. The plaintext to display in the footer. Does not support markdown format.
          - `snippet` Snippet: A snippet object representing an excerpt from a larger corpus.
            - `imagePreview` ElementsImage: An object encapsulating different ways of representing an image. Currently supported representations: * An image fetched from a URI. Additional representations might be supported in the future.
              - …
            - `text` string: Optional. A short plaintext excerpt directly from the corpus that is rendered in the citation hover card or source preview. When footer sources are automatically populated from inline `citations` (because `Elements.cited_sources` is not set), snippets are omitted from the deduplicated footer sources. Does not support markdown format, and must not exceed 1,000 characters.
          - `title` string: Required. The plaintext title of the `CitedSource`. Does not support markdown format.
          - `uri` string: Required. The URI pointing to the resource referenced by this `CitedSource`.
      - `emojiReactionSummaries` EmojiReactionSummary[]: Output only. The list of emoji reaction summaries on the message.
        - `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).
            - `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:`
            - `name` string: Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
            - `payload` CustomEmojiPayload: Payload data for the custom emoji.
              - …
            - `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.
            - `uid` string: Output only. Unique key for the custom emoji resource.
          - `unicode` string: Optional. A basic emoji represented by a unicode string.
        - `reactionCount` integer: Output only. The total number of reactions using the associated emoji.
      - `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.
      - `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)
      - `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.
      - `markupSyntax` 'MARKUP_SYNTAX_UNSPECIFIED' | 'MARKUP_SYNTAX_CHAT' | 'MARKUP_SYNTAX_MARKDOWN': Optional. Specifies how the server interprets the message `text` field content when creating a message or updating the `text` field of a message. When calling `UpdateMessage`, set `markup_syntax` and `text` on the `Message` resource and include `text` (not `markup_syntax`) in `update_mask`.
      - `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.
      - `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).
      - `privateMessageViewer` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
        - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `domainId` string: Unique identifier of the user's Google Workspace domain.
        - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
        - `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.
      - `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).
        - `forwardedMetadata` ForwardedMetadata: Metadata about the source space from which a message was forwarded.
          - `space` string: Output only. The resource name of the source space. Format: spaces/{space}
          - `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").
        - `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}`
        - `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
          - `annotations` Annotation[]: Output only. Annotations parsed from the text body of the quoted message. Populated only for FORWARD quote type.
            - `customEmojiMetadata` CustomEmojiMetadata: Annotation metadata for custom emoji.
              - …
            - `length` integer: Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
            - `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.
              - …
            - `slashCommand` SlashCommandMetadata: Annotation metadata for slash commands (/).
              - …
            - `startIndex` integer: Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
            - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI': The type of this annotation.
            - `userMention` UserMentionMetadata: Annotation metadata for user mentions (@).
              - …
          - `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.
            - `attachmentDataRef` AttachmentDataRef: A reference to the attachment data.
              - …
            - `contentName` string: Output only. The original file name for the content, not the full path.
            - `contentType` string: Output only. The content type (MIME type) of the file.
            - `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.
            - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
              - …
            - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
            - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
            - `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.
          - `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.
          - `text` string: Output only. Snapshot of the quoted message's text content.
      - `sender` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
        - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `domainId` string: Unique identifier of the user's Google Workspace domain.
        - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
        - `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.
      - `silent` boolean: Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.
      - `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.
      - `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.
        - `accessSettings` AccessSettings: Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space.
          - `accessPermissionSettings` AccessPermissionSettings: Access permission settings for a space.
            - `discoverSpaceSetting` AccessPermissionSetting: An access permission setting.
              - …
            - `joinSpaceSetting` AccessPermissionSetting: An access permission setting.
              - …
            - `viewSpaceMembershipSetting` AccessPermissionSetting: An access permission setting.
              - …
          - `accessState` 'ACCESS_STATE_UNSPECIFIED' | 'PRIVATE' | 'DISCOVERABLE': Output only. Indicates the access state of the space.
          - `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).
        - `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.
        - `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`.
        - `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.
        - `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.
        - `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.
        - `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).
        - `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.
        - `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.
        - `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`.
        - `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.
          - `manageApps` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `manageMembersAndGroups` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `manageWebhooks` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `modifySpaceDetails` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `postMessages` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `replyMessages` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `toggleHistory` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `useAtMentionAll` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `viewSpaceMembership` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `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)
        - `singleUserBotDm` boolean: Optional. Whether the space is a DM between a Chat app and a single human.
        - `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 4,096 characters.
          - `guidelines` string: Optional. The space's rules, expectations, and etiquette. Supports up to 5,000 characters.
        - `spaceHistoryState` 'HISTORY_STATE_UNSPECIFIED' | 'HISTORY_OFF' | 'HISTORY_ON': Optional. The message history state for messages and threads in this space.
        - `spaceThreadingState` 'SPACE_THREADING_STATE_UNSPECIFIED' | 'THREADED_MESSAGES' | 'GROUPED_MESSAGES' | 'UNTHREADED_MESSAGES': Output only. The threading state in the Chat space.
        - `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.
        - `spaceUri` string: Output only. The URI for a user to access the space.
        - `threaded` boolean: Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
        - `type` 'TYPE_UNSPECIFIED' | 'ROOM' | 'DM': Output only. Deprecated: Use `space_type` instead. The type of a space.
      - `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).
      - `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.
      - `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`.
  - `messageDeletedEventData` MessageDeletedEventData: Event payload for a deleted message. Event type: `google.workspace.chat.message.v1.deleted`
    - `message` Message: A message in a Google Chat space.
      - `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.
            - `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".
            - `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(''); }; // ...
              - …
            - `disabled` boolean: If `true`, the button is displayed in an inactive state and doesn't respond to user actions.
            - `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):
              - …
            - `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):
              - …
            - `text` string: The text displayed inside the button.
            - `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.
      - `actionResponse` ActionResponse: Parameters that a Chat app can use to configure how its response is posted.
        - `dialogAction` DialogAction: Contains a [dialog](https://developers.google.com/workspace/chat/dialogs) and request status code.
          - `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.
          - `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" } ] } } } ] } } ] } ] } } ] } ```
              - …
        - `type` 'TYPE_UNSPECIFIED' | 'NEW_MESSAGE' | 'UPDATE_MESSAGE' | 'UPDATE_USER_MESSAGE_CARDS' | 'REQUEST_CONFIG' | 'DIALOG' | 'UPDATE_WIDGET': Input only. The type of Chat app response.
        - `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.
              - …
          - `widget` string: The ID of the updated widget. The ID must match the one for the widget that triggered the update request.
        - `url` string: Input only. URL for users to authenticate or configure. (Only for `REQUEST_CONFIG` response types.)
      - `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.
        - `customEmojiMetadata` CustomEmojiMetadata: Annotation metadata for custom emoji.
          - `customEmoji` CustomEmoji: Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
            - `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:`
            - `name` string: Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
            - `payload` CustomEmojiPayload: Payload data for the custom emoji.
              - …
            - `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.
            - `uid` string: Output only. Unique key for the custom emoji resource.
        - `length` integer: Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
        - `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.
          - `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.
            - `message` string: The message of the linked Chat space resource. Format: `spaces/{space}/messages/{message}`
            - `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}`
          - `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.
          - `meetSpaceLinkData` MeetSpaceLinkData: Data for Meet space links.
            - `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.
            - `type` 'TYPE_UNSPECIFIED' | 'MEETING' | 'HUDDLE': Indicates the type of the Meet space.
          - `richLinkType` 'RICH_LINK_TYPE_UNSPECIFIED' | 'DRIVE_FILE' | 'CHAT_SPACE' | 'GMAIL_MESSAGE' | 'MEET_SPACE' | 'CALENDAR_EVENT': The rich link type.
          - `uri` string: The URI of this link.
        - `slashCommand` SlashCommandMetadata: Annotation metadata for slash commands (/).
          - `bot` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
            - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `domainId` string: Unique identifier of the user's Google Workspace domain.
            - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
            - `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.
          - `commandId` string, int64: The command ID of the invoked slash command.
          - `commandName` string: The name of the invoked slash command.
          - `triggersDialog` boolean: Indicates whether the slash command is for a dialog.
          - `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.
        - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI': The type of this annotation.
        - `userMention` UserMentionMetadata: Annotation metadata for user mentions (@).
          - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'MENTION': The type of user mention.
          - `user` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
            - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `domainId` string: Unique identifier of the user's Google Workspace domain.
            - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
            - `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.
      - `argumentText` string: Output only. Plain-text body of the message with all Chat app mentions stripped out.
      - `attachedGifs` AttachedGif[]: Output only. GIF images that are attached to the message.
        - `uri` string: Output only. The URL that hosts the GIF image.
      - `attachment` Attachment[]: Optional. User-uploaded attachment.
        - `attachmentDataRef` AttachmentDataRef: A reference to 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.
          - `resourceName` string: Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data.
        - `contentName` string: Output only. The original file name for the content, not the full path.
        - `contentType` string: Output only. The content type (MIME type) of the file.
        - `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.
        - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
          - `driveFileId` string: The ID for the drive file. Use with the Drive API.
        - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
        - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
        - `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.
      - `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.
        - `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.
              - …
            - `openLink` OpenLink: A link that opens a new window.
              - …
        - `header` CardHeader
          - `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.
          - `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.
        - `name` string: Name of the card.
        - `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.
            - `buttons` Button[]: A list of buttons. Buttons is also `oneof data` and only one of these fields should be set.
              - …
            - `image` Image: An image that's specified by a URL and can have an `onclick` action.
              - …
            - `keyValue` KeyValue: A UI element contains a key (label) and a value (content). This element can also contain some actions such as `onclick` button.
              - …
            - `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).
              - …
      - `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)
        - `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" } ] } } } ] } } ] } ] } } ] } ```
          - `cardActions` GoogleAppsCardV1CardAction[]: The card's actions. Actions are added to the card's toolbar menu. Supports up to 10 `CardAction` items. [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" } } } ] ```
            - `actionLabel` string: The label that displays as the action menu item.
            - `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):
              - …
          - `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):
          - `expressionData` GoogleAppsCardV1ExpressionData[]: The expression data for the card. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
            - `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.
              - …
            - `expression` string: The uncompiled expression.
            - `id` string: The unique identifier of the ExpressionData.
          - `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):
            - `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):
              - …
            - `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):
              - …
          - `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):
            - `imageAltText` string: The alternative text of this image that's used for accessibility.
            - `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.
            - `subtitle` string: The subtitle of the card header. If specified, appears on its own line below the `title`.
            - `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.
          - `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):
          - `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):
            - `imageAltText` string: The alternative text of this image that's used for accessibility.
            - `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.
            - `subtitle` string: The subtitle of the card header. If specified, appears on its own line below the `title`.
            - `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.
          - `sectionDividerStyle` 'DIVIDER_STYLE_UNSPECIFIED' | 'SOLID_DIVIDER' | 'NO_DIVIDER': The divider style between the header, sections and footer.
          - `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).
            - `collapseControl` GoogleAppsCardV1CollapseControl: Represent an expand and collapse control. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `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`.
            - `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.
            - `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`.
            - `widgets` GoogleAppsCardV1Widget[]: All the widgets in the section. Must contain at least one widget. A card supports up to 100 widgets across all sections.
              - …
        - `cardId` string: Required if the message contains multiple cards. A unique identifier for a card in a message.
        - `ownerUser` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
      - `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).
      - `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.
      - `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.
      - `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.
      - `elements` Elements: Elements are additional message components, including inline `citations` (where each citation is associated with a specific portion of the message text) and `cited_sources` (which are general references used to generate the response and are not directly linked to specific segments of the text). Both `citations` and `cited_sources` can be provided as input when creating or updating a message and are populated on output when reading a message.
        - `citations` Citation[]: Optional. A list of inline citations referenced within the message text (via `` tags) that render as interactive hover cards.
          - `citedSources` CitedSource[]: Optional. A list of sources that are relevant to the citation. Sources are displayed in the citation hover card.
            - `footer` Footer: A footer for a source, used for attribution.
              - …
            - `snippet` Snippet: A snippet object representing an excerpt from a larger corpus.
              - …
            - `title` string: Required. The plaintext title of the `CitedSource`. Does not support markdown format.
            - `uri` string: Required. The URI pointing to the resource referenced by this `CitedSource`.
          - `id` string: Required. The ID of the citation. This ID is defined by the app creating the citation and must match the `data-id` attribute of the `` tag in the message text. Must contain only ASCII letters and numbers, and less than 63 characters.
        - `citedSources` CitedSource[]: Optional. A list of sources to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.
          - `footer` Footer: A footer for a source, used for attribution.
            - `text` string: Optional. The plaintext to display in the footer. Does not support markdown format.
          - `snippet` Snippet: A snippet object representing an excerpt from a larger corpus.
            - `imagePreview` ElementsImage: An object encapsulating different ways of representing an image. Currently supported representations: * An image fetched from a URI. Additional representations might be supported in the future.
              - …
            - `text` string: Optional. A short plaintext excerpt directly from the corpus that is rendered in the citation hover card or source preview. When footer sources are automatically populated from inline `citations` (because `Elements.cited_sources` is not set), snippets are omitted from the deduplicated footer sources. Does not support markdown format, and must not exceed 1,000 characters.
          - `title` string: Required. The plaintext title of the `CitedSource`. Does not support markdown format.
          - `uri` string: Required. The URI pointing to the resource referenced by this `CitedSource`.
      - `emojiReactionSummaries` EmojiReactionSummary[]: Output only. The list of emoji reaction summaries on the message.
        - `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).
            - `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:`
            - `name` string: Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
            - `payload` CustomEmojiPayload: Payload data for the custom emoji.
              - …
            - `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.
            - `uid` string: Output only. Unique key for the custom emoji resource.
          - `unicode` string: Optional. A basic emoji represented by a unicode string.
        - `reactionCount` integer: Output only. The total number of reactions using the associated emoji.
      - `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.
      - `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)
      - `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.
      - `markupSyntax` 'MARKUP_SYNTAX_UNSPECIFIED' | 'MARKUP_SYNTAX_CHAT' | 'MARKUP_SYNTAX_MARKDOWN': Optional. Specifies how the server interprets the message `text` field content when creating a message or updating the `text` field of a message. When calling `UpdateMessage`, set `markup_syntax` and `text` on the `Message` resource and include `text` (not `markup_syntax`) in `update_mask`.
      - `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.
      - `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).
      - `privateMessageViewer` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
        - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `domainId` string: Unique identifier of the user's Google Workspace domain.
        - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
        - `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.
      - `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).
        - `forwardedMetadata` ForwardedMetadata: Metadata about the source space from which a message was forwarded.
          - `space` string: Output only. The resource name of the source space. Format: spaces/{space}
          - `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").
        - `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}`
        - `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
          - `annotations` Annotation[]: Output only. Annotations parsed from the text body of the quoted message. Populated only for FORWARD quote type.
            - `customEmojiMetadata` CustomEmojiMetadata: Annotation metadata for custom emoji.
              - …
            - `length` integer: Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
            - `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.
              - …
            - `slashCommand` SlashCommandMetadata: Annotation metadata for slash commands (/).
              - …
            - `startIndex` integer: Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
            - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI': The type of this annotation.
            - `userMention` UserMentionMetadata: Annotation metadata for user mentions (@).
              - …
          - `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.
            - `attachmentDataRef` AttachmentDataRef: A reference to the attachment data.
              - …
            - `contentName` string: Output only. The original file name for the content, not the full path.
            - `contentType` string: Output only. The content type (MIME type) of the file.
            - `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.
            - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
              - …
            - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
            - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
            - `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.
          - `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.
          - `text` string: Output only. Snapshot of the quoted message's text content.
      - `sender` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
        - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `domainId` string: Unique identifier of the user's Google Workspace domain.
        - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
        - `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.
      - `silent` boolean: Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.
      - `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.
      - `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.
        - `accessSettings` AccessSettings: Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space.
          - `accessPermissionSettings` AccessPermissionSettings: Access permission settings for a space.
            - `discoverSpaceSetting` AccessPermissionSetting: An access permission setting.
              - …
            - `joinSpaceSetting` AccessPermissionSetting: An access permission setting.
              - …
            - `viewSpaceMembershipSetting` AccessPermissionSetting: An access permission setting.
              - …
          - `accessState` 'ACCESS_STATE_UNSPECIFIED' | 'PRIVATE' | 'DISCOVERABLE': Output only. Indicates the access state of the space.
          - `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).
        - `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.
        - `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`.
        - `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.
        - `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.
        - `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.
        - `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).
        - `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.
        - `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.
        - `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`.
        - `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.
          - `manageApps` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `manageMembersAndGroups` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `manageWebhooks` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `modifySpaceDetails` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `postMessages` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `replyMessages` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `toggleHistory` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `useAtMentionAll` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
          - `viewSpaceMembership` PermissionSetting: Represents a space permission setting.
            - `assistantManagersAllowed` boolean: Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.
            - `managersAllowed` boolean: Optional. Whether space owners (`ROLE_MANAGER`) have this permission.
            - `membersAllowed` boolean: Optional. Whether basic space members (`ROLE_MEMBER`) have this permission.
        - `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)
        - `singleUserBotDm` boolean: Optional. Whether the space is a DM between a Chat app and a single human.
        - `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 4,096 characters.
          - `guidelines` string: Optional. The space's rules, expectations, and etiquette. Supports up to 5,000 characters.
        - `spaceHistoryState` 'HISTORY_STATE_UNSPECIFIED' | 'HISTORY_OFF' | 'HISTORY_ON': Optional. The message history state for messages and threads in this space.
        - `spaceThreadingState` 'SPACE_THREADING_STATE_UNSPECIFIED' | 'THREADED_MESSAGES' | 'GROUPED_MESSAGES' | 'UNTHREADED_MESSAGES': Output only. The threading state in the Chat space.
        - `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.
        - `spaceUri` string: Output only. The URI for a user to access the space.
        - `threaded` boolean: Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space.
        - `type` 'TYPE_UNSPECIFIED' | 'ROOM' | 'DM': Output only. Deprecated: Use `space_type` instead. The type of a space.
      - `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).
      - `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.
      - `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`.
  - `messageUpdatedEventData` MessageUpdatedEventData: Event payload for an updated message. Event type: `google.workspace.chat.message.v1.updated`
    - `message` Message: A message in a Google Chat space.
      - `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.
            - `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".
            - `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(''); }; // ...
              - …
            - `disabled` boolean: If `true`, the button is displayed in an inactive state and doesn't respond to user actions.
            - `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):
              - …
            - `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):
              - …
            - `text` string: The text displayed inside the button.
            - `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.
      - `actionResponse` ActionResponse: Parameters that a Chat app can use to configure how its response is posted.
        - `dialogAction` DialogAction: Contains a [dialog](https://developers.google.com/workspace/chat/dialogs) and request status code.
          - `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.
          - `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" } ] } } } ] } } ] } ] } } ] } ```
              - …
        - `type` 'TYPE_UNSPECIFIED' | 'NEW_MESSAGE' | 'UPDATE_MESSAGE' | 'UPDATE_USER_MESSAGE_CARDS' | 'REQUEST_CONFIG' | 'DIALOG' | 'UPDATE_WIDGET': Input only. The type of Chat app response.
        - `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.
              - …
          - `widget` string: The ID of the updated widget. The ID must match the one for the widget that triggered the update request.
        - `url` string: Input only. URL for users to authenticate or configure. (Only for `REQUEST_CONFIG` response types.)
      - `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.
        - `customEmojiMetadata` CustomEmojiMetadata: Annotation metadata for custom emoji.
          - `customEmoji` CustomEmoji: Represents a [custom emoji](https://support.google.com/chat/answer/12800149).
            - `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:`
            - `name` string: Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
            - `payload` CustomEmojiPayload: Payload data for the custom emoji.
              - …
            - `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.
            - `uid` string: Output only. Unique key for the custom emoji resource.
        - `length` integer: Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
        - `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.
          - `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.
            - `message` string: The message of the linked Chat space resource. Format: `spaces/{space}/messages/{message}`
            - `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}`
          - `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.
          - `meetSpaceLinkData` MeetSpaceLinkData: Data for Meet space links.
            - `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.
            - `type` 'TYPE_UNSPECIFIED' | 'MEETING' | 'HUDDLE': Indicates the type of the Meet space.
          - `richLinkType` 'RICH_LINK_TYPE_UNSPECIFIED' | 'DRIVE_FILE' | 'CHAT_SPACE' | 'GMAIL_MESSAGE' | 'MEET_SPACE' | 'CALENDAR_EVENT': The rich link type.
          - `uri` string: The URI of this link.
        - `slashCommand` SlashCommandMetadata: Annotation metadata for slash commands (/).
          - `bot` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
            - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `domainId` string: Unique identifier of the user's Google Workspace domain.
            - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
            - `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.
          - `commandId` string, int64: The command ID of the invoked slash command.
          - `commandName` string: The name of the invoked slash command.
          - `triggersDialog` boolean: Indicates whether the slash command is for a dialog.
          - `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.
        - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI': The type of this annotation.
        - `userMention` UserMentionMetadata: Annotation metadata for user mentions (@).
          - `type` 'TYPE_UNSPECIFIED' | 'ADD' | 'MENTION': The type of user mention.
          - `user` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
            - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `domainId` string: Unique identifier of the user's Google Workspace domain.
            - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
            - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
            - `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.
      - `argumentText` string: Output only. Plain-text body of the message with all Chat app mentions stripped out.
      - `attachedGifs` AttachedGif[]: Output only. GIF images that are attached to the message.
        - `uri` string: Output only. The URL that hosts the GIF image.
      - `attachment` Attachment[]: Optional. User-uploaded attachment.
        - `attachmentDataRef` AttachmentDataRef: A reference to 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.
          - `resourceName` string: Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data.
        - `contentName` string: Output only. The original file name for the content, not the full path.
        - `contentType` string: Output only. The content type (MIME type) of the file.
        - `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.
        - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
          - `driveFileId` string: The ID for the drive file. Use with the Drive API.
        - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
        - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
        - `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.
      - `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.
        - `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.
              - …
            - `openLink` OpenLink: A link that opens a new window.
              - …
        - `header` CardHeader
          - `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.
          - `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.
        - `name` string: Name of the card.
        - `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.
            - `buttons` Button[]: A list of buttons. Buttons is also `oneof data` and only one of these fields should be set.
              - …
            - `image` Image: An image that's specified by a URL and can have an `onclick` action.
              - …
            - `keyValue` KeyValue: A UI element contains a key (label) and a value (content). This element can also contain some actions such as `onclick` button.
              - …
            - `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).
              - …
      - `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)
        - `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" } ] } } } ] } } ] } ] } } ] } ```
          - `cardActions` GoogleAppsCardV1CardAction[]: The card's actions. Actions are added to the card's toolbar menu. Supports up to 10 `CardAction` items. [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" } } } ] ```
            - `actionLabel` string: The label that displays as the action menu item.
            - `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):
              - …
          - `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):
          - `expressionData` GoogleAppsCardV1ExpressionData[]: The expression data for the card. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps.
            - `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.
              - …
            - `expression` string: The uncompiled expression.
            - `id` string: The unique identifier of the ExpressionData.
          - `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):
            - `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):
              - …
            - `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):
              - …
          - `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):
            - `imageAltText` string: The alternative text of this image that's used for accessibility.
            - `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.
            - `subtitle` string: The subtitle of the card header. If specified, appears on its own line below the `title`.
            - `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.
          - `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):
          - `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):
            - `imageAltText` string: The alternative text of this image that's used for accessibility.
            - `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.
            - `subtitle` string: The subtitle of the card header. If specified, appears on its own line below the `title`.
            - `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.
          - `sectionDividerStyle` 'DIVIDER_STYLE_UNSPECIFIED' | 'SOLID_DIVIDER' | 'NO_DIVIDER': The divider style between the header, sections and footer.
          - `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).
            - `collapseControl` GoogleAppsCardV1CollapseControl: Represent an expand and collapse control. [Google Workspace add-ons and Chat apps](https://developers.google.com/workspace/extend):
              - …
            - `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`.
            - `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.
            - `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`.
            - `widgets` GoogleAppsCardV1Widget[]: All the widgets in the section. Must contain at least one widget. A card supports up to 100 widgets across all sections.
              - …
        - `cardId` string: Required if the message contains multiple cards. A unique identifier for a card in a message.
        - `ownerUser` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
          - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `domainId` string: Unique identifier of the user's Google Workspace domain.
          - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
          - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
          - `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.
      - `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).
      - `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.
      - `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.
      - `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.
      - `elements` Elements: Elements are additional message components, including inline `citations` (where each citation is associated with a specific portion of the message text) and `cited_sources` (which are general references used to generate the response and are not directly linked to specific segments of the text). Both `citations` and `cited_sources` can be provided as input when creating or updating a message and are populated on output when reading a message.
        - `citations` Citation[]: Optional. A list of inline citations referenced within the message text (via `` tags) that render as interactive hover cards.
          - `citedSources` CitedSource[]: Optional. A list of sources that are relevant to the citation. Sources are displayed in the citation hover card.
            - `footer` Footer: A footer for a source, used for attribution.
              - …
            - `snippet` Snippet: A snippet object representing an excerpt from a larger corpus.
              - …
            - `title` string: Required. The plaintext title of the `CitedSource`. Does not support markdown format.
            - `uri` string: Required. The URI pointing to the resource referenced by this `CitedSource`.
          - `id` string: Required. The ID of the citation. This ID is defined by the app creating the citation and must match the `data-id` attribute of the `` tag in the message text. Must contain only ASCII letters and numbers, and less than 63 characters.
        - `citedSources` CitedSource[]: Optional. A list of sources to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.
          - `footer` Footer: A footer for a source, used for attribution.
            - `text` string: Optional. The plaintext to display in the footer. Does not support markdown format.
          - `snippet` Snippet: A snippet object representing an excerpt from a larger corpus.
            - `imagePreview` ElementsImage: An object encapsulating different ways of representing an image. Currently supported representations: * An image fetched from a URI. Additional representations might be supported in the future.
              - …
            - `text` string: Optional. A short plaintext excerpt directly from the corpus that is rendered in the citation hover card or source preview. When footer sources are automatically populated from inline `citations` (because `Elements.cited_sources` is not set), snippets are omitted from the deduplicated footer sources. Does not support markdown format, and must not exceed 1,000 characters.
          - `title` string: Required. The plaintext title of the `CitedSource`. Does not support markdown format.
          - `uri` string: Required. The URI pointing to the resource referenced by this `CitedSource`.
      - `emojiReactionSummaries` EmojiReactionSummary[]: Output only. The list of emoji reaction summaries on the message.
        - `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).
            - `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:`
            - `name` string: Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`
            - `payload` CustomEmojiPayload: Payload data for the custom emoji.
              - …
            - `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.
            - `uid` string: Output only. Unique key for the custom emoji resource.
          - `unicode` string: Optional. A basic emoji represented by a unicode string.
        - `reactionCount` integer: Output only. The total number of reactions using the associated emoji.
      - `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.
      - `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)
      - `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.
      - `markupSyntax` 'MARKUP_SYNTAX_UNSPECIFIED' | 'MARKUP_SYNTAX_CHAT' | 'MARKUP_SYNTAX_MARKDOWN': Optional. Specifies how the server interprets the message `text` field content when creating a message or updating the `text` field of a message. When calling `UpdateMessage`, set `markup_syntax` and `text` on the `Message` resource and include `text` (not `markup_syntax`) in `update_mask`.
      - `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.
      - `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).
      - `privateMessageViewer` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
        - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `domainId` string: Unique identifier of the user's Google Workspace domain.
        - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
        - `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.
      - `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).
        - `forwardedMetadata` ForwardedMetadata: Metadata about the source space from which a message was forwarded.
          - `space` string: Output only. The resource name of the source space. Format: spaces/{space}
          - `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").
        - `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}`
        - `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
          - `annotations` Annotation[]: Output only. Annotations parsed from the text body of the quoted message. Populated only for FORWARD quote type.
            - `customEmojiMetadata` CustomEmojiMetadata: Annotation metadata for custom emoji.
              - …
            - `length` integer: Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.
            - `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.
              - …
            - `slashCommand` SlashCommandMetadata: Annotation metadata for slash commands (/).
              - …
            - `startIndex` integer: Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to.
            - `type` 'ANNOTATION_TYPE_UNSPECIFIED' | 'USER_MENTION' | 'SLASH_COMMAND' | 'RICH_LINK' | 'CUSTOM_EMOJI': The type of this annotation.
            - `userMention` UserMentionMetadata: Annotation metadata for user mentions (@).
              - …
          - `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.
            - `attachmentDataRef` AttachmentDataRef: A reference to the attachment data.
              - …
            - `contentName` string: Output only. The original file name for the content, not the full path.
            - `contentType` string: Output only. The content type (MIME type) of the file.
            - `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.
            - `driveDataRef` DriveDataRef: A reference to the data of a drive attachment.
              - …
            - `name` string: Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
            - `source` 'SOURCE_UNSPECIFIED' | 'DRIVE_FILE' | 'UPLOADED_CONTENT': Output only. The source of the attachment.
            - `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.
          - `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.
          - `text` string: Output only. Snapshot of the quoted message's text content.
      - `sender` User: If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output for a `User` resource (such as in the Messages and Memberships APIs) only populates the `name` and `type` fields for both internal and external users, unless they are members of the space or have prior affinity with the calling user.
        - `avatarUrl` string: Output only. The user's avatar image URL. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `displayName` string: Output only. The user's display name. Populated for both app authentication and user authentication. This field is always populated for requests made with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app). When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `domainId` string: Unique identifier of the user's Google Workspace domain.
        - `email` string: Output only. The user's email address. When calling the Messages and Memberships APIs with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), this field is populated for both internal and external users for the `sender` of a message, users within `annotations` (such as user mentions), and within `Membership` resources, provided the user is a member of the space or has prior affinity with the calling user.
        - `isAnonymous` boolean: Output only. When `true`, the user is deleted or their profile is not visible, such as when a user is mentioned in a space without being a member and without prior affinity with the calling user.
        - `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.
      - `silent` boolean: Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients.
      - `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.
      - `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.
        - `accessSettings` AccessSettings: Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space.
          - `accessPermissionSettings` AccessPermissionSettings: Access permission settings for a space.
            - `discoverSpaceSetting` AccessPermissionSetting: An access permission setting.
              - …
            - `joinSpaceSetting` AccessPermissionSetting: An access permission setting.
              - …
            - `viewSpaceMembershipSetting` AccessPermissionSetting: An access permission setting.
              - …
          - `accessState` 'ACCESS_STATE_UNSPECIFIED' | 'PRIVATE' | 'DISCOVERABLE': Output only. Indicates the access state of the space.
          - `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).
        - `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.
        - `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`.
        - `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.
        - `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.
        - `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.
        - `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).
        - `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.
        - `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.
        - `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`.
- … truncated; see the full OpenAPI document linked below

## Changes

- **2026-11-02** `ffee5784d4b1`: 4 info
  - the security scope `https://www.googleapis.com/auth/chat.app.all.memberships.readonly` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/chat.app.all.memberships.readonly` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/chat.spaces.readonly` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/chat.spaces.readonly` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/chat/changes/v1/spaces/:spacesId/spaceEvents/:spaceEventsId/get.md)

---

[API](https://skmtc.dev/google/apis/chat.md) - [All operations](https://skmtc.dev/google/apis/chat/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/chat/revisions/ffee5784d4b1?raw)
