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

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

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

## Request

- Base URL: `https://chat.googleapis.com`
- URL: `https://chat.googleapis.com/v1/spaces/{spacesId}/spaceEvents`
- 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`

Lists events from a Google Chat space. For each event, the [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload) contains the most recent version of the Chat resource. For example, if you list events about new space members, the server returns `Membership` resources that contain the latest membership details. If new members were removed during the requested period, the event payload contains an empty `Membership` resource. 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 list events, the authenticated caller must be a member of the space. For an example, see [List events from a Google Chat space](https://developers.google.com/workspace/chat/list-space-events).

## Path parameters

- `spacesId` string, required

## Query parameters

- `filter` string
- `pageSize` integer
- `pageToken` string

## Response `200`

Successful response

- ListSpaceEventsResponse: Response message for listing space events.
  - `nextPageToken` string: Continuation token used to fetch more events. If this field is omitted, there are no subsequent pages.
  - `spaceEvents` SpaceEvent[]: Results are returned in chronological order (oldest event first). Note: The `permissionSettings` field is not returned in the Space object for list requests.
    - `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):
              - …
          - `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.
              - …
            - `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.
              - …
            - `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.
              - …
            - `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 (@).
              - …
          - `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.
              - …
            - `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.
          - `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.
              - …
            - `header` CardHeader
              - …
            - `name` string: Name of the card.
            - `sections` Section[]: Sections are separated by a line divider.
              - …
          - `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" } ] } } } ] } } ] } ] } } ] } ```
              - …
            - `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.
              - …
          - `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 to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.
              - …
          - `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.
              - …
            - `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.
              - …
            - `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
              - …
          - `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.
              - …
            - `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.
              - …
            - `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.
              - …
            - `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.
              - …
            - `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):
              - …
          - `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.
              - …
            - `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.
              - …
            - `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.
              - …
            - `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 (@).
              - …
          - `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.
              - …
            - `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.
          - `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.
              - …
            - `header` CardHeader
              - …
            - `name` string: Name of the card.
            - `sections` Section[]: Sections are separated by a line divider.
              - …
          - `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" } ] } } } ] } } ] } ] } } ] } ```
              - …
            - `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.
              - …
          - `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 to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.
              - …
          - `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.
              - …
            - `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.
              - …
            - `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
              - …
          - `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.
              - …
            - `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.
              - …
            - `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.
              - …
            - `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.
              - …
            - `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):
              - …
          - `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.
              - …
            - `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.
              - …
            - `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.
              - …
            - `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 (@).
              - …
          - `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.
              - …
            - `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.
          - `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.
              - …
            - `header` CardHeader
              - …
            - `name` string: Name of the card.
            - `sections` Section[]: Sections are separated by a line divider.
              - …
          - `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" } ] } } } ] } } ] } ] } } ] } ```
              - …
            - `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.
              - …
          - `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 to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.
              - …
          - `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.
              - …
            - `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.
              - …
            - `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
              - …
          - `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.
              - …
            - `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.
              - …
            - `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.
              - …
            - `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.
              - …
            - `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.
              - …
        - `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`.
    - `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.
              - …
        - `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`.
    - `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.
              - …
        - `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`.
    - `name` string: Resource name of the space event. Format: `spaces/{space}/spaceEvents/{spaceEvent}`
    - `reactionBatchCreatedEventData` ReactionBatchCreatedEventData: Event payload for multiple new reactions. Event type: `google.workspace.chat.reaction.v1.batchCreated`
      - `reactions` ReactionCreatedEventData[]: A list of new reactions.
        - `reaction` Reaction: A reaction to a 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.
          - `name` string: Identifier. The resource name of the reaction. Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
          - `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.
    - `reactionBatchDeletedEventData` ReactionBatchDeletedEventData: Event payload for multiple deleted reactions. Event type: `google.workspace.chat.reaction.v1.batchDeleted`
      - `reactions` ReactionDeletedEventData[]: A list of deleted reactions.
        - `reaction` Reaction: A reaction to a 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.
          - `name` string: Identifier. The resource name of the reaction. Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
          - `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.
    - `reactionCreatedEventData` ReactionCreatedEventData: Event payload for a new reaction. Event type: `google.workspace.chat.reaction.v1.created`
      - `reaction` Reaction: A reaction to a 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.
        - `name` string: Identifier. The resource name of the reaction. Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
        - `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.
    - `reactionDeletedEventData` ReactionDeletedEventData: Event payload for a deleted reaction. Type: `google.workspace.chat.reaction.v1.deleted`
      - `reaction` Reaction: A reaction to a 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.
        - `name` string: Identifier. The resource name of the reaction. Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
        - `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.
    - `spaceBatchUpdatedEventData` SpaceBatchUpdatedEventData: Event payload for multiple updates to a space. Event type: `google.workspace.chat.space.v1.batchUpdated`
      - `spaces` SpaceUpdatedEventData[]: A list of updated spaces.
        - `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.
    - `spaceUpdatedEventData` SpaceUpdatedEventData: Event payload for an updated space. Event type: `google.workspace.chat.space.v1.updated`
      - `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.

## 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/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)
