Index
ChatService
(interface)AccessoryWidget
(message)ActionResponse
(message)ActionResponse.ResponseType
(enum)ActionResponse.SelectionItems
(message)ActionResponse.UpdatedWidget
(message)ActionStatus
(message)Annotation
(message)AnnotationType
(enum)AttachedGif
(message)Attachment
(message)Attachment.Source
(enum)AttachmentDataRef
(message)CardWithId
(message)ChatSpaceLinkData
(message)CompleteImportSpaceRequest
(message)CompleteImportSpaceResponse
(message)ContextualAddOnMarkup
(message)ContextualAddOnMarkup.Card
(message)ContextualAddOnMarkup.Card.CardAction
(message)ContextualAddOnMarkup.Card.CardHeader
(message)ContextualAddOnMarkup.Card.CardHeader.ImageStyle
(enum)ContextualAddOnMarkup.Card.Section
(message)CreateMembershipRequest
(message)CreateMessageRequest
(message)CreateMessageRequest.MessageReplyOption
(enum)CreateReactionRequest
(message)CreateSpaceRequest
(message)CustomEmoji
(message)DeleteMembershipRequest
(message)DeleteMessageRequest
(message)DeleteReactionRequest
(message)DeleteSpaceRequest
(message)DeletionMetadata
(message)DeletionMetadata.DeletionType
(enum)Dialog
(message)DialogAction
(message)DriveDataRef
(message)DriveLinkData
(message)Emoji
(message)EmojiReactionSummary
(message)FindDirectMessageRequest
(message)GetAttachmentRequest
(message)GetMembershipRequest
(message)GetMessageRequest
(message)GetSpaceEventRequest
(message)GetSpaceReadStateRequest
(message)GetSpaceRequest
(message)GetThreadReadStateRequest
(message)Group
(message)HistoryState
(enum)ListMembershipsRequest
(message)ListMembershipsResponse
(message)ListMessagesRequest
(message)ListMessagesResponse
(message)ListReactionsRequest
(message)ListReactionsResponse
(message)ListSpaceEventsRequest
(message)ListSpaceEventsResponse
(message)ListSpacesRequest
(message)ListSpacesResponse
(message)MatchedUrl
(message)Membership
(message)Membership.MembershipRole
(enum)Membership.MembershipState
(enum)MembershipBatchCreatedEventData
(message)MembershipBatchDeletedEventData
(message)MembershipBatchUpdatedEventData
(message)MembershipCreatedEventData
(message)MembershipDeletedEventData
(message)MembershipUpdatedEventData
(message)Message
(message)MessageBatchCreatedEventData
(message)MessageBatchDeletedEventData
(message)MessageBatchUpdatedEventData
(message)MessageCreatedEventData
(message)MessageDeletedEventData
(message)MessageUpdatedEventData
(message)QuotedMessageMetadata
(message)Reaction
(message)ReactionBatchCreatedEventData
(message)ReactionBatchDeletedEventData
(message)ReactionCreatedEventData
(message)ReactionDeletedEventData
(message)RichLinkMetadata
(message)RichLinkMetadata.RichLinkType
(enum)SearchSpacesRequest
(message)SearchSpacesResponse
(message)SetUpSpaceRequest
(message)SlashCommand
(message)SlashCommandMetadata
(message)SlashCommandMetadata.Type
(enum)Space
(message)Space.AccessSettings
(message)Space.AccessSettings.AccessState
(enum)Space.MembershipCount
(message)Space.PermissionSetting
(message)Space.PermissionSettings
(message)Space.PredefinedPermissionSettings
(enum)Space.SpaceDetails
(message)Space.SpaceThreadingState
(enum)Space.SpaceType
(enum)Space.Type
(enum)SpaceBatchUpdatedEventData
(message)SpaceEvent
(message)SpaceReadState
(message)SpaceUpdatedEventData
(message)Thread
(message)ThreadReadState
(message)UpdateMembershipRequest
(message)UpdateMessageRequest
(message)UpdateSpaceReadStateRequest
(message)UpdateSpaceRequest
(message)User
(message)User.Type
(enum)UserMentionMetadata
(message)UserMentionMetadata.Type
(enum)WidgetMarkup
(message)WidgetMarkup.Button
(message)WidgetMarkup.FormAction
(message)WidgetMarkup.FormAction.ActionParameter
(message)WidgetMarkup.Icon
(enum)WidgetMarkup.Image
(message)WidgetMarkup.ImageButton
(message)WidgetMarkup.KeyValue
(message)WidgetMarkup.OnClick
(message)WidgetMarkup.OpenLink
(message)WidgetMarkup.TextButton
(message)WidgetMarkup.TextParagraph
(message)
ChatService
Enables developers to build Chat apps and integrations on Google Chat Platform.
CompleteImportSpace |
---|
Completes the import process for the specified space and makes it visible to users. Requires app authentication and domain-wide delegation. For more information, see Authorize Google Chat apps to import data.
|
CreateMembership |
---|
Creates a membership for the calling Chat app, a user, or a Google Group. Creating memberships for other Chat apps isn't supported. When creating a membership, if the specified member has their auto-accept policy turned off, then they're invited, and must accept the space invitation before joining. Otherwise, creating a membership adds the member directly to the specified space. Requires user authentication. For example usage, see:
|
CreateMessage |
---|
Creates a message in a Google Chat space. For an example, see Send a message. The The following image shows how Chat attributes a message when you use app authentication. Chat displays the Chat app as the message sender. The content of the message can contain text ( The following image shows how Chat attributes a message when you use user authentication. Chat displays the user as the message sender and attributes the Chat app to the message by displaying its name. The content of message can only contain text ( The maximum message size, including the message contents, is 32,000 bytes.
|
CreateReaction |
---|
Creates a reaction and adds it to a message. Only unicode emojis are supported. For an example, see Add a reaction to a message. Requires user authentication.
|
CreateSpace |
---|
Creates a named space. Spaces grouped by topics aren't supported. For an example, see Create a space. If you receive the error message Requires user authentication.
|
DeleteMembership |
---|
Deletes a membership. For an example, see Remove a user or a Google Chat app from a space. Requires user authentication.
|
DeleteMessage |
---|
Deletes a message. For an example, see Delete a message. Requires authentication. Supports app authentication and user authentication. When using app authentication, requests can only delete messages created by the calling Chat app.
|
DeleteReaction |
---|
Deletes a reaction to a message. Only unicode emojis are supported. For an example, see Delete a reaction. Requires user authentication.
|
DeleteSpace |
---|
Deletes a named space. Always performs a cascading delete, which means that the space's child resources—like messages posted in the space and memberships in the space—are also deleted. For an example, see Delete a space. Requires user authentication from a user who has permission to delete the space.
|
FindDirectMessage |
---|
Returns the existing direct message with the specified user. If no direct message space is found, returns a With user authentication, returns the direct message space between the specified user and the authenticated user. With app authentication, returns the direct message space between the specified user and the calling Chat app. Requires user authentication or app authentication.
|
GetAttachment |
---|
Gets the metadata of a message attachment. The attachment data is fetched using the media API. For an example, see Get metadata about a message attachment. Requires app authentication.
|
GetMembership |
---|
Returns details about a membership. For an example, see Get details about a user's or Google Chat app's membership. Requires authentication. Supports app authentication and user authentication.
|
GetMessage |
---|
Returns details about a message. For an example, see Get details about a message. Requires authentication. Supports app authentication and user authentication. Note: Might return a message from a blocked member or space.
|
GetSpace |
---|
Returns details about a space. For an example, see Get details about a space. Requires authentication. Supports app authentication and user authentication.
|
GetSpaceEvent |
---|
Returns an event from a Google Chat space. The event payload contains the most recent version of the resource that changed. For example, if you request an event about a new message but the message was later updated, the server returns the updated Requires user authentication. To get an event, the authenticated user must be a member of the space. For an example, see Get details about an event from a Google Chat space.
|
GetSpaceReadState |
---|
Returns details about a user's read state within a space, used to identify read and unread messages. For an example, see Get details about a user's space read state. Requires user authentication.
|
GetThreadReadState |
---|
Returns details about a user's read state within a thread, used to identify read and unread messages. For an example, see Get details about a user's thread read state. Requires user authentication.
|
ListMemberships |
---|
Lists memberships in a space. For an example, see List users and Google Chat apps in a space. Listing memberships with app authentication lists memberships in spaces that the Chat app has access to, but excludes Chat app memberships, including its own. Listing memberships with User authentication lists memberships in spaces that the authenticated user has access to. Requires authentication. Supports app authentication and user authentication.
|
ListMessages |
---|
Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. If you list messages from a space with no messages, the response is an empty object. When using a REST/HTTP interface, the response contains an empty JSON object,
|
ListReactions |
---|
Lists reactions to a message. For an example, see List reactions for a message. Requires user authentication.
|
ListSpaceEvents |
---|
Lists events from a Google Chat space. For each event, the payload contains the most recent version of the Chat resource. For example, if you list events about new space members, the server returns Requires user authentication. To list events, the authenticated user must be a member of the space. For an example, see List events from a Google Chat space.
|
ListSpaces |
---|
Lists spaces the caller is a member of. Group chats and DMs aren't listed until the first message is sent. For an example, see List spaces. Requires authentication. Supports app authentication and user authentication. Lists spaces visible to the caller or authenticated user. Group chats and DMs aren't listed until the first message is sent. To list all named spaces by Google Workspace organization, use the
|
SearchSpaces |
---|
Returns a list of spaces based on a user's search. Requires user authentication. The user must be an administrator for the Google Workspace organization. In the request, set
|
SetUpSpace |
---|
Creates a space and adds specified users to it. The calling user is automatically added to the space, and shouldn't be specified as a membership in the request. For an example, see Set up a space with initial members. To specify the human members to add, add memberships with the appropriate To specify the Google groups to add, add memberships with the appropriate For a named space or group chat, if the caller blocks, or is blocked by some members, or doesn't have permission to add some members, then those members aren't added to the created space. To create a direct message (DM) between the calling user and another human user, specify exactly one membership to represent the human user. If one user blocks the other, the request fails and the DM isn't created. To create a DM between the calling user and the calling app, set If a DM already exists between two users, even when one user blocks the other at the time a request is made, then the existing DM is returned. Spaces with threaded replies aren't supported. If you receive the error message Requires user authentication.
|
UpdateMembership |
---|
Updates a membership. For an example, see Update a user's membership in a space. Requires user authentication.
|
UpdateMessage |
---|
Updates a message. There's a difference between the Requires authentication. Supports app authentication and user authentication. When using app authentication, requests can only update messages created by the calling Chat app.
|
UpdateSpace |
---|
Updates a space. For an example, see Update a space. If you're updating the Requires user authentication.
|
UpdateSpaceReadState |
---|
Updates a user's read state within a space, used to identify read and unread messages. For an example, see Update a user's space read state. Requires user authentication.
|
AccessoryWidget
One or more interactive widgets that appear at the bottom of a message. For details, see Add interactive widgets at the bottom of a message.
Fields | |
---|---|
Union field action . The type of action. action can be only one of the following: |
|
button_list |
A list of buttons. |
ActionResponse
Parameters that a Chat app can use to configure how its response is posted.
Fields | |
---|---|
type |
Input only. The type of Chat app response. |
url |
Input only. URL for users to authenticate or configure. (Only for |
dialog_action |
Input only. A response to an interaction event related to a dialog. Must be accompanied by |
updated_widget |
Input only. The response of the updated widget. |
ResponseType
The type of Chat app response.
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default type that's handled as NEW_MESSAGE . |
NEW_MESSAGE |
Post as a new message in the topic. |
UPDATE_MESSAGE |
Update the Chat app's message. This is only permitted on a CARD_CLICKED event where the message sender type is BOT . |
UPDATE_USER_MESSAGE_CARDS |
Update the cards on a user's message. This is only permitted as a response to a MESSAGE event with a matched url, or a CARD_CLICKED event where the message sender type is HUMAN . Text is ignored. |
REQUEST_CONFIG |
Privately ask the user for additional authentication or configuration. |
DIALOG |
Presents a dialog. |
UPDATE_WIDGET |
Widget text autocomplete options query. |
SelectionItems
List of widget autocomplete results.
Fields | |
---|---|
items[] |
An array of the SelectionItem objects. |
UpdatedWidget
The response of the updated widget. Used to provide autocomplete options for a widget.
Fields | |
---|---|
widget |
The ID of the updated widget. The ID must match the one for the widget that triggered the update request. |
Union field updated_widget . The widget updated in response to a user action. updated_widget can be only one of the following: |
|
suggestions |
List of widget autocomplete results |
ActionStatus
Represents the status for a request to either invoke or submit a dialog.
Fields | |
---|---|
status_code |
The status code. |
user_facing_message |
The message to send users about the status of their request. If unset, a generic message based on the |
Annotation
Output only. Annotations associated with the plain-text body of the message. To add basic formatting to a text message, see Format text messages.
Example plain-text message body:
Hello @FooBot how are you!"
The corresponding annotations metadata:
"annotations":[{
"type":"USER_MENTION",
"startIndex":6,
"length":7,
"userMention": {
"user": {
"name":"users/{user}",
"displayName":"FooBot",
"avatarUrl":"https://goo.gl/aeDtrS",
"type":"BOT"
},
"type":"MENTION"
}
}]
Fields | |
---|---|
type |
The type of this annotation. |
length |
Length of the substring in the plain-text message body this annotation corresponds to. |
start_index |
Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to. |
Union field metadata . Additional metadata about the annotation. metadata can be only one of the following: |
|
user_mention |
The metadata of user mention. |
slash_command |
The metadata for a slash command. |
rich_link_metadata |
The metadata for a rich link. |
AnnotationType
Type of the annotation.
Enums | |
---|---|
ANNOTATION_TYPE_UNSPECIFIED |
Default value for the enum. Don't use. |
USER_MENTION |
A user is mentioned. |
SLASH_COMMAND |
A slash command is invoked. |
RICH_LINK |
A rich link annotation. |
AttachedGif
A GIF image that's specified by a URL.
Fields | |
---|---|
uri |
Output only. The URL that hosts the GIF image. |
Attachment
An attachment in Google Chat.
Fields | |
---|---|
name |
Resource name of the attachment, in the form |
content_name |
Output only. The original file name for the content, not the full path. |
content_type |
Output only. The content type (MIME type) of the file. |
thumbnail_uri |
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. |
download_uri |
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. |
source |
Output only. The source of the attachment. |
Union field data_ref . The data reference to the attachment. data_ref can be only one of the following: |
|
attachment_data_ref |
A reference to the attachment data. This field is used with the media API to download the attachment data. |
drive_data_ref |
Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API. |
Source
The source of the attachment.
Enums | |
---|---|
SOURCE_UNSPECIFIED |
Reserved. |
DRIVE_FILE |
The file is a Google Drive file. |
UPLOADED_CONTENT |
The file is uploaded to Chat. |
AttachmentDataRef
A reference to the attachment data.
Fields | |
---|---|
resource_name |
The resource name of the attachment data. This field is used with the media API to download the attachment data. |
attachment_upload_token |
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. |
CardWithId
A card in a Google Chat message.
Only Chat apps can create cards. If your Chat app authenticates as a user, the message can't contain cards.
Design and preview cards with the Card Builder.
Open the Card BuilderFields | |
---|---|
card_id |
Required if the message contains multiple cards. A unique identifier for a card in a message. |
card |
A card. Maximum size is 32 KB. |
ChatSpaceLinkData
Data for Chat space links.
Fields | |
---|---|
space |
The space of the linked Chat space resource. Format: |
thread |
The thread of the linked Chat space resource. Format: |
message |
The message of the linked Chat space resource. Format: |
CompleteImportSpaceRequest
Request message for completing the import process for a space.
Fields | |
---|---|
name |
Required. Resource name of the import mode space. Format: |
CompleteImportSpaceResponse
Response message for completing the import process for a space.
Fields | |
---|---|
space |
The import mode space. |
ContextualAddOnMarkup
This type has no fields.
The markup for developers to specify the contents of a contextual AddOn.
Card
A card is a UI element that can contain UI widgets such as text and images.
Fields | |
---|---|
header |
The header of the card. A header usually contains a title and an image. |
sections[] |
Sections are separated by a line divider. |
card_actions[] |
The actions of this card. |
name |
Name of the card. |
CardAction
A card action is the action associated with the card. For an invoice card, a typical action would be: delete invoice, email invoice or open the invoice in browser.
Not supported by Google Chat apps.
Fields | |
---|---|
action_label |
The label used to be displayed in the action menu item. |
on_click |
The onclick action for this action item. |
CardHeader
Fields | |
---|---|
title |
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. |
subtitle |
The subtitle of the card header. |
image_style |
The image's type (for example, square border or circular border). |
image_url |
The URL of the image in the card header. |
ImageStyle
Enums | |
---|---|
IMAGE_STYLE_UNSPECIFIED |
|
IMAGE |
Square border. |
AVATAR |
Circular border. |
Section
A section contains a collection of widgets that are rendered (vertically) in the order that they are specified. Across all platforms, cards have a narrow fixed width, so there's currently no need for layout properties (for example, float).
Fields | |
---|---|
header |
The header of the section. Formatted text is supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons. |
widgets[] |
A section must contain at least one widget. |
CreateMembershipRequest
Request message for creating a membership.
Fields | |
---|---|
parent |
Required. The resource name of the space for which to create the membership. Format: spaces/{space} |
membership |
Required. The membership relation to create. The |
use_admin_access |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires the Creating app memberships or creating memberships for users outside the administrator's Google Workspace organization isn't supported using admin access. |
CreateMessageRequest
Creates a message.
Fields | |
---|---|
parent |
Required. The resource name of the space in which to create a message. Format: |
message |
Required. Message body. |
thread_key |
Optional. Deprecated: Use |
request_id |
Optional. A unique request ID for this message. Specifying an existing request ID returns the message created with that ID instead of creating a new message. |
message_reply_option |
Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. |
message_id |
Optional. A custom ID for a message. Lets Chat apps get, update, or delete a message without needing to store the system-assigned ID in the message's resource name (represented in the message The value for this field must meet the following requirements:
For details, see Name a message. |
MessageReplyOption
Specifies how to reply to a message. More states might be added in the future.
Enums | |
---|---|
MESSAGE_REPLY_OPTION_UNSPECIFIED |
Default. Starts a new thread. Using this option ignores any thread ID or that's included. |
REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD |
Creates the message as a reply to the thread specified by thread ID or . If it fails, the message starts a new thread instead. |
REPLY_MESSAGE_OR_FAIL |
Creates the message as a reply to the thread specified by thread ID or . If a new thread_key is used, a new thread is created. If the message creation fails, a NOT_FOUND error is returned instead. |
CreateReactionRequest
Creates a reaction to a message.
Fields | |
---|---|
parent |
Required. The message where the reaction is created. Format: |
reaction |
Required. The reaction to create. |
CreateSpaceRequest
A request to create a named space.
Fields | |
---|---|
space |
Required. The If you receive the error message The space |
request_id |
Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error. |
CustomEmoji
Represents a custom emoji.
Fields | |
---|---|
uid |
Output only. Unique key for the custom emoji resource. |
DeleteMembershipRequest
Request to delete a membership in a space.
Fields | |
---|---|
name |
Required. Resource name of the membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships. When deleting a human membership, requires the When deleting an app membership, requires the Format: |
use_admin_access |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires the Deleting app memberships in a space isn't supported using admin access. |
DeleteMessageRequest
Request to delete a message.
Fields | |
---|---|
name |
Required. Resource name of the message. Format: If you've set a custom ID for your message, you can use the value from the |
force |
When Only applies when authenticating as a user. Has no effect when authenticating as a Chat app. |
DeleteReactionRequest
Deletes a reaction to a message.
Fields | |
---|---|
name |
Required. Name of the reaction to delete. Format: |
DeleteSpaceRequest
Request for deleting a space.
Fields | |
---|---|
name |
Required. Resource name of the space to delete. Format: |
use_admin_access |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires the |
DeletionMetadata
Information about a deleted message. A message is deleted when delete_time
is set.
Fields | |
---|---|
deletion_type |
Indicates who deleted the message. |
DeletionType
Who deleted the message and how it was deleted.
Enums | |
---|---|
DELETION_TYPE_UNSPECIFIED |
This value is unused. |
CREATOR |
User deleted their own message. |
SPACE_OWNER |
The space owner deleted the message. |
ADMIN |
A Google Workspace admin deleted the message. |
APP_MESSAGE_EXPIRY |
A Chat app deleted its own message when it expired. |
CREATOR_VIA_APP |
A Chat app deleted the message on behalf of the user. |
SPACE_OWNER_VIA_APP |
A Chat app deleted the message on behalf of the space owner. |
Dialog
Wrapper around the card body of the dialog.
Fields | |
---|---|
body |
Input only. Body of the dialog, which is rendered in a modal. Google Chat apps don't support the following card entities: |
DialogAction
Contains a dialog and request status code.
Fields | |
---|---|
action_status |
Input only. Status for a request to either invoke or submit a dialog. Displays a status and message to users, if necessary. For example, in case of an error or success. |
Union field action . Action to perform. action can be only one of the following: |
|
dialog |
Input only. Dialog for the request. |
DriveDataRef
A reference to the data of a drive attachment.
Fields | |
---|---|
drive_file_id |
The ID for the drive file. Use with the Drive API. |
DriveLinkData
Data for Google Drive links.
Fields | |
---|---|
drive_data_ref |
A DriveDataRef which references a Google Drive file. |
mime_type |
The mime type of the linked Google Drive resource. |
Emoji
An emoji that is used as a reaction to a message.
Fields | |
---|---|
Union field content . The content of the emoji. content can be only one of the following: |
|
unicode |
A basic emoji represented by a unicode string. |
custom_emoji |
Output only. A custom emoji. |
EmojiReactionSummary
The number of people who reacted to a message with a specific emoji.
Fields | |
---|---|
emoji |
Emoji associated with the reactions. |
reaction_count |
The total number of reactions using the associated emoji. |
FindDirectMessageRequest
A request to get direct message space based on the user resource.
Fields | |
---|---|
name |
Required. Resource name of the user to find direct message with. Format: |
GetAttachmentRequest
Request to get an attachment.
Fields | |
---|---|
name |
Required. Resource name of the attachment, in the form |
GetMembershipRequest
Request to get a membership of a space.
Fields | |
---|---|
name |
Required. Resource name of the membership to retrieve. To get the app's own membership by using user authentication, you can optionally use Format: When authenticated as a user, you can use the user's email as an alias for |
use_admin_access |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires the Getting app memberships in a space isn't supported when using admin access. |
GetMessageRequest
Request to get a message.
Fields | |
---|---|
name |
Required. Resource name of the message. Format: If you've set a custom ID for your message, you can use the value from the |
GetSpaceEventRequest
Request message for getting a space event.
Fields | |
---|---|
name |
Required. The resource name of the space event. Format: |
GetSpaceReadStateRequest
Request message for GetSpaceReadState API.
Fields | |
---|---|
name |
Required. Resource name of the space read state to retrieve. Only supports getting read state for the calling user. To refer to the calling user, set one of the following:
Format: users/{user}/spaces/{space}/spaceReadState |
GetSpaceRequest
A request to return a single space.
Fields | |
---|---|
name |
Required. Resource name of the space, in the form Format: |
use_admin_access |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires the |
GetThreadReadStateRequest
Request message for GetThreadReadStateRequest API.
Fields | |
---|---|
name |
Required. Resource name of the thread read state to retrieve. Only supports getting read state for the calling user. To refer to the calling user, set one of the following:
Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState |
Group
A Google Group in Google Chat.
Fields | |
---|---|
name |
Resource name for a Google Group. Represents a group in Cloud Identity Groups API. Format: groups/{group} |
HistoryState
The history state for messages and spaces. Specifies how long messages and conversation threads are kept after creation.
Enums | |
---|---|
HISTORY_STATE_UNSPECIFIED |
Default value. Do not use. |
HISTORY_OFF |
History off. Messages and threads are kept for 24 hours. |
HISTORY_ON |
History on. The organization's Vault retention rules specify for how long messages and threads are kept. |
ListMembershipsRequest
Request message for listing memberships.
Fields | |
---|---|
parent |
Required. The resource name of the space for which to fetch a membership list. Format: spaces/{space} |
page_size |
Optional. The maximum number of memberships to return. The service might return fewer than this value. If unspecified, at most 100 memberships are returned. The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000. Negative values return an |
page_token |
Optional. A page token, received from a previous call to list memberships. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results. |
filter |
Optional. A query filter. You can filter memberships by a member's role ( To filter by role, set To filter by type, set To filter by both role and type, use the Either For example, the following queries are valid:
The following queries are invalid:
Invalid queries are rejected by the server with an |
show_groups |
Optional. When |
show_invited |
Optional. When Currently requires user authentication. |
use_admin_access |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires either the Listing app memberships in a space isn't supported when using admin access. |
ListMembershipsResponse
Response to list memberships of the space.
Fields | |
---|---|
memberships[] |
Unordered list. List of memberships in the requested (or first) page. |
next_page_token |
A token that you can send as |
ListMessagesRequest
Lists messages in the specified space, that the user is a member of.
Fields | |
---|---|
parent |
Required. The resource name of the space to list messages from. Format: |
page_size |
The maximum number of messages returned. The service might return fewer messages than this value. If unspecified, at most 25 are returned. The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000. Negative values return an |
page_token |
Optional, if resuming from a previous query. A page token received from a previous list messages call. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results. |
filter |
A query filter. You can filter messages by date ( To filter messages by the date they were created, specify the To filter by thread, specify the To filter by both thread and date, use the For example, the following queries are valid:
Invalid queries are rejected by the server with an |
order_by |
Optional, if resuming from a previous query. How the list of messages is ordered. Specify a value to order by an ordering operation. Valid ordering operation values are as follows:
The default ordering is |
show_deleted |
Whether to include deleted messages. Deleted messages include deleted time and metadata about their deletion, but message content is unavailable. |
ListMessagesResponse
Response message for listing messages.
Fields | |
---|---|
messages[] |
List of messages. |
next_page_token |
You can send a token as |
ListReactionsRequest
Lists reactions to a message.
Fields | |
---|---|
parent |
Required. The message users reacted to. Format: |
page_size |
Optional. The maximum number of reactions returned. The service can return fewer reactions than this value. If unspecified, the default value is 25. The maximum value is 200; values above 200 are changed to 200. |
page_token |
Optional. (If resuming from a previous query.) A page token received from a previous list reactions call. Provide this to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value might lead to unexpected results. |
filter |
Optional. A query filter. You can filter reactions by emoji (either To filter reactions for multiple emojis or users, join similar fields with the To filter reactions by emoji and user, use the If your query uses both For example, the following queries are valid:
The following queries are invalid:
Invalid queries are rejected by the server with an |
ListReactionsResponse
Response to a list reactions request.
Fields | |
---|---|
reactions[] |
List of reactions in the requested (or first) page. |
next_page_token |
Continuation token to retrieve the next page of results. It's empty for the last page of results. |
ListSpaceEventsRequest
Request message for listing space events.
Fields | |
---|---|
parent |
Required. Resource name of the Google Chat space where the events occurred. Format: |
page_size |
Optional. The maximum number of space events returned. The service might return fewer than this value. Negative values return an |
page_token |
A page token, received from a previous list space events call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to list space events must match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results. |
filter |
Required. A query filter. You must specify at least one event type ( Optionally, you can also filter by start time (
To specify a start or end time, use the equals For example, the following queries are valid:
The following queries are invalid:
Invalid queries are rejected by the server with an |
ListSpaceEventsResponse
Response message for listing space events.
Fields | |
---|---|
space_events[] |
Results are returned in chronological order (oldest event first). |
next_page_token |
Continuation token used to fetch more events. If this field is omitted, there are no subsequent pages. |
ListSpacesRequest
A request to list the spaces the caller is a member of.
Fields | |
---|---|
page_size |
Optional. The maximum number of spaces to return. The service might return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000. Negative values return an |
page_token |
Optional. A page token, received from a previous list spaces call. Provide this parameter to retrieve the subsequent page. When paginating, the filter value should match the call that provided the page token. Passing a different value may lead to unexpected results. |
filter |
Optional. A query filter. You can filter spaces by the space type ( To filter by space type, you must specify valid enum value, such as For example, the following queries are valid:
Invalid queries are rejected by the server with an |
ListSpacesResponse
The response for a list spaces request.
Fields | |
---|---|
spaces[] |
List of spaces in the requested (or first) page. |
next_page_token |
You can send a token as |
MatchedUrl
A matched URL in a Chat message. Chat apps can preview matched URLs. For more information, see Preview links.
Fields | |
---|---|
url |
Output only. The URL that was matched. |
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.
Fields | |
---|---|
name |
Resource name of the membership, assigned by the server. Format: |
state |
Output only. State of the membership. |
role |
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 |
create_time |
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. |
delete_time |
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. |
Union field memberType . Member associated with this membership. Other member types might be supported in the future. memberType can be only one of the following: |
|
member |
The Google Chat user or app the membership corresponds to. If your Chat app authenticates as a user, the output populates the user |
group_member |
The Google Group the membership corresponds to. |
MembershipRole
Represents a user's permitted actions in a Chat space. More enum values might be added in the future.
Enums | |
---|---|
MEMBERSHIP_ROLE_UNSPECIFIED |
Default value. For users : they aren't a member of the space, but can be invited. For Google Groups : they're always assigned this role (other enum values might be used in the future). |
ROLE_MEMBER |
A member of the space. The user has basic permissions, like sending messages to the space. In 1:1 and unnamed group conversations, everyone has this role. |
ROLE_MANAGER |
A space manager. The user has all basic permissions plus administrative permissions that let them manage the space, like adding or removing members. Only supported in SpaceType.SPACE . |
MembershipState
Specifies the member's relationship with a space. Other membership states might be supported in the future.
Enums | |
---|---|
MEMBERSHIP_STATE_UNSPECIFIED |
Default value. Don't use. |
JOINED |
The user is added to the space, and can participate in the space. |
INVITED |
The user is invited to join the space, but hasn't joined it. |
NOT_A_MEMBER |
The user doesn't belong to the space and doesn't have a pending invitation to join the space. |
MembershipBatchCreatedEventData
Event payload for multiple new memberships.
Event type: google.workspace.chat.membership.v1.batchCreated
Fields | |
---|---|
memberships[] |
A list of new memberships. |
MembershipBatchDeletedEventData
Event payload for multiple deleted memberships.
Event type: google.workspace.chat.membership.v1.batchDeleted
Fields | |
---|---|
memberships[] |
A list of deleted memberships. |
MembershipBatchUpdatedEventData
Event payload for multiple updated memberships.
Event type: google.workspace.chat.membership.v1.batchUpdated
Fields | |
---|---|
memberships[] |
A list of updated memberships. |
MembershipCreatedEventData
Event payload for a new membership.
Event type: google.workspace.chat.membership.v1.created
.
Fields | |
---|---|
membership |
The new membership. |
MembershipDeletedEventData
Event payload for a deleted membership.
Event type: google.workspace.chat.membership.v1.deleted
Fields | |
---|---|
membership |
The deleted membership. Only the |
MembershipUpdatedEventData
Event payload for an updated membership.
Event type: google.workspace.chat.membership.v1.updated
Fields | |
---|---|
membership |
The updated membership. |
Message
A message in a Google Chat space.
Fields | |
---|---|
name |
Resource name of the message. Format: Where 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 |
sender |
Output only. The user who created the message. If your Chat app authenticates as a user, the output populates the user |
create_time |
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. |
last_update_time |
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. |
delete_time |
Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty. |
text |
Plain-text body of the message. The first link to an image, video, or web page generates a preview chip. You can also @mention a Google Chat user, or everyone in the space. To learn about creating text messages, see Send a message. |
formatted_text |
Output only. Contains the message
For more information, see View text formatting sent in a message |
cards[] |
Deprecated: Use 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_v2[] |
An array of cards. Only Chat apps can create cards. If your Chat app authenticates as a user, the messages can't contain cards. To learn how to create a message that contains cards, see Send a message. Design and preview cards with the Card Builder. Open the Card Builder |
annotations[] |
Output only. Annotations associated with the |
thread |
The thread the message belongs to. For example usage, see Start or reply to a message thread. |
space |
If your Chat app authenticates as a user, the output populates the space |
fallback_text |
A plain-text description of the message's cards, used when the actual cards can't be displayed—for example, mobile notifications. |
action_response |
Input only. Parameters that a Chat app can use to configure how its response is posted. |
argument_text |
Output only. Plain-text body of the message with all Chat app mentions stripped out. |
slash_command |
Output only. Slash command information, if applicable. |
attachment[] |
User-uploaded attachment. |
matched_url |
Output only. A URL in |
thread_reply |
Output only. When If the space doesn't support reply in threads, this field is always |
client_assigned_message_id |
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 |
emoji_reaction_summaries[] |
Output only. The list of emoji reaction summaries on the message. |
private_message_viewer |
Immutable. Input for creating a message, otherwise output only. The user that can view the message. When set, the message is private and only visible to the specified user and the Chat app. Link previews and attachments aren't supported for private messages. Only Chat apps can send private messages. If your Chat app authenticates as a user to send a message, the message can't be private and must omit this field. For details, see Send a message privately. |
deletion_metadata |
Output only. Information about a deleted message. A message is deleted when |
quoted_message_metadata |
Output only. Information about a message that's quoted by a Google Chat user in a space. Google Chat users can quote a message to reply to it. |
attached_gifs[] |
Output only. GIF images that are attached to the message. |
accessory_widgets[] |
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. Creating a message with accessory widgets requires app authentication. |
MessageBatchCreatedEventData
Event payload for multiple new messages.
Event type: google.workspace.chat.message.v1.batchCreated
Fields | |
---|---|
messages[] |
A list of new messages. |
MessageBatchDeletedEventData
Event payload for multiple deleted messages.
Event type: google.workspace.chat.message.v1.batchDeleted
Fields | |
---|---|
messages[] |
A list of deleted messages. |
MessageBatchUpdatedEventData
Event payload for multiple updated messages.
Event type: google.workspace.chat.message.v1.batchUpdated
Fields | |
---|---|
messages[] |
A list of updated messages. |
MessageCreatedEventData
Event payload for a new message.
Event type: google.workspace.chat.message.v1.created
Fields | |
---|---|
message |
The new message. |
MessageDeletedEventData
Event payload for a deleted message.
Event type: google.workspace.chat.message.v1.deleted
Fields | |
---|---|
message |
The deleted message. Only the |
MessageUpdatedEventData
Event payload for an updated message.
Event type: google.workspace.chat.message.v1.updated
Fields | |
---|---|
message |
The updated message. |
QuotedMessageMetadata
Information about a quoted message.
Fields | |
---|---|
name |
Output only. Resource name of the quoted message. Format: |
last_update_time |
Output only. The timestamp when the quoted message was created or when the quoted message was last updated. |
Reaction
A reaction to a message.
Fields | |
---|---|
name |
The resource name of the reaction. Format: |
user |
Output only. The user who created the reaction. |
emoji |
The emoji used in the reaction. |
ReactionBatchCreatedEventData
Event payload for multiple new reactions.
Event type: google.workspace.chat.reaction.v1.batchCreated
Fields | |
---|---|
reactions[] |
A list of new reactions. |
ReactionBatchDeletedEventData
Event payload for multiple deleted reactions.
Event type: google.workspace.chat.reaction.v1.batchDeleted
Fields | |
---|---|
reactions[] |
A list of deleted reactions. |
ReactionCreatedEventData
Event payload for a new reaction.
Event type: google.workspace.chat.reaction.v1.created
Fields | |
---|---|
reaction |
The new reaction. |
ReactionDeletedEventData
Event payload for a deleted reaction.
Type: google.workspace.chat.reaction.v1.deleted
Fields | |
---|---|
reaction |
The deleted reaction. |
RichLinkMetadata
A rich link to a resource.
Fields | |
---|---|
uri |
The URI of this link. |
rich_link_type |
The rich link type. |
Union field data . Data for the linked resource. data can be only one of the following: |
|
drive_link_data |
Data for a drive link. |
chat_space_link_data |
Data for a chat space link. |
RichLinkType
The rich link type. More types might be added in the future.
Enums | |
---|---|
RICH_LINK_TYPE_UNSPECIFIED |
Default value for the enum. Don't use. |
DRIVE_FILE |
A Google Drive rich link type. |
CHAT_SPACE |
A Chat space rich link type. For example, a space smart chip. |
SearchSpacesRequest
Request to search for a list of spaces based on a query.
Fields | |
---|---|
use_admin_access |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires either the This method currently only supports admin access, thus only |
page_size |
The maximum number of spaces to return. The service may return fewer than this value. If unspecified, at most 100 spaces are returned. The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000. |
page_token |
A token, received from the previous search spaces call. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results. |
query |
Required. A search query. You can search by using the following parameters:
Across different fields, only Among the same field, The following example queries are valid:
|
order_by |
Optional. How the list of spaces is ordered. Supported attributes to order by are:
Valid ordering operation values are:
The supported syntax are:
|
SearchSpacesResponse
Response with a list of spaces corresponding to the search spaces request.
Fields | |
---|---|
spaces[] |
A page of the requested spaces. |
next_page_token |
A token that can be used to retrieve the next page. If this field is empty, there are no subsequent pages. |
total_size |
The total number of spaces that match the query, across all pages. If the result is over 10,000 spaces, this value is an estimate. |
SetUpSpaceRequest
Request to create a space and add specified users to it.
Fields | |
---|---|
space |
Required. The To create a space, set To create a group chat, set To create a 1:1 conversation between humans, set To create an 1:1 conversation between a human and the calling Chat app, set If a |
request_id |
Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error. |
memberships[] |
Optional. The Google Chat users or groups to invite to join the space. Omit the calling user, as they are added automatically. The set currently allows up to 20 memberships (in addition to the caller). For human membership, the For Google group membership, the Optional when setting Required when setting Required when setting Must be empty when creating a 1:1 conversation between a human and the calling Chat app (when setting |
SlashCommand
A slash command in Google Chat.
Fields | |
---|---|
command_id |
The ID of the slash command invoked. |
SlashCommandMetadata
Annotation metadata for slash commands (/).
Fields | |
---|---|
bot |
The Chat app whose command was invoked. |
type |
The type of slash command. |
command_name |
The name of the invoked slash command. |
command_id |
The command ID of the invoked slash command. |
triggers_dialog |
Indicates whether the slash command is for a dialog. |
Type
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default value for the enum. Don't use. |
ADD |
Add Chat app to space. |
INVOKE |
Invoke slash command in 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.
Fields | |
---|---|
name |
Resource name of the space. Format: Where |
type |
Output only. Deprecated: Use |
space_type |
The type of space. Required when creating a space or updating the space type of a space. Output only for other usage. |
single_user_bot_dm |
Optional. Whether the space is a DM between a Chat app and a single human. |
threaded |
Output only. Deprecated: Use |
display_name |
The space's display name. Required when creating a space. If you receive the error message For direct messages, this field might be empty. Supports up to 128 characters. |
external_user_allowed |
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:
For existing spaces, this field is output only. |
space_threading_state |
Output only. The threading state in the Chat space. |
space_details |
Details about the space including description and rules. |
space_history_state |
The message history state for messages and threads in this space. |
import_mode |
Optional. Whether this space is created in |
create_time |
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 |
last_active_time |
Output only. Timestamp of the last message in the space. |
admin_installed |
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. |
membership_count |
Output only. The count of joined memberships grouped by member type. Populated when the |
access_settings |
Optional. Specifies the access setting of the space. Only populated when the |
space_uri |
Output only. The URI for a user to access the space. |
Union field space_permission_settings . Represents the permission settings of a space. Only populated when the space_type is SPACE . space_permission_settings can be only one of the following: |
|
predefined_permission_settings |
Optional. Input only. Space permission settings. Input for creating a space, a collaboration space is created if this field is not set. After you create the space, settings are populated in the |
permission_settings |
Optional. Exact permission settings which can be set to update the space. Input for updating a space. Otherwise, output only. For space creation, use |
AccessSettings
Represents the access setting of the space.
Fields | |
---|---|
access_state |
Output only. Indicates the access state of the space. |
audience |
Optional. The resource name of the target audience 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. Format: To use the default target audience for the Google Workspace organization, set to |
AccessState
Represents the access state of the space.
Enums | |
---|---|
ACCESS_STATE_UNSPECIFIED |
Access state is unknown or not supported in this API. |
PRIVATE |
Only users or Google Groups that have been individually added or invited by other users or Google Workspace administrators can discover and access the space. |
DISCOVERABLE |
A space manager has granted a target audience access to the space. Users or Google Groups that have been individually added or invited to the space can also discover and access the space. To learn more, see Make a space discoverable to specific users. |
MembershipCount
Represents the count of memberships of a space, grouped into categories.
Fields | |
---|---|
joined_direct_human_user_count |
Count of human users that have directly joined the space, not counting users joined by having membership in a joined group. |
joined_group_count |
Count of all groups that have directly joined the space. |
PermissionSetting
Represents a space permission setting.
Fields | |
---|---|
managers_allowed |
Whether spaces managers have this permission. |
members_allowed |
Whether non-manager members have this permission. |
PermissionSettings
Permission settings for a named space. To set permission settings when creating a space, specify the PredefinedPermissionSettings
field in your request.
Fields | |
---|---|
manage_members_and_groups |
Setting for managing members and groups in a space. |
modify_space_details |
Setting for updating space name, avatar, description and guidelines. |
toggle_history |
Setting for toggling space history on and off. |
use_at_mention_all |
Setting for using @all in a space. |
manage_apps |
Setting for managing apps in a space. |
manage_webhooks |
Setting for managing webhooks in a space. |
post_messages |
Output only. Setting for posting messages in a space. |
reply_messages |
Setting for replying to messages in a space. |
PredefinedPermissionSettings
The space permission settings that you can specify when creating a named space. More settings might be added in the future. For details about permission settings for named spaces, see Learn about spaces.
Enums | |
---|---|
PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED |
Unspecified. Don't use. |
COLLABORATION_SPACE |
Setting to make the space a collaboration space where all members can post messages. |
ANNOUNCEMENT_SPACE |
Setting to make the space an announcement space where only space managers can post messages. |
SpaceDetails
Details about the space including description and rules.
Fields | |
---|---|
description |
Optional. A description of the space. For example, describe the space's discussion topic, functional purpose, or participants. Supports up to 150 characters. |
guidelines |
Optional. The space's rules, expectations, and etiquette. Supports up to 5,000 characters. |
SpaceThreadingState
Specifies the type of threading state in the Chat space.
Enums | |
---|---|
SPACE_THREADING_STATE_UNSPECIFIED |
Reserved. |
THREADED_MESSAGES |
Named spaces that support message threads. When users respond to a message, they can reply in-thread, which keeps their response in the context of the original message. |
GROUPED_MESSAGES |
Named spaces where the conversation is organized by topic. Topics and their replies are grouped together. |
UNTHREADED_MESSAGES |
Direct messages (DMs) between two people and group conversations between 3 or more people. |
SpaceType
The type of space. Required when creating or updating a space. Output only for other usage.
Enums | |
---|---|
SPACE_TYPE_UNSPECIFIED |
Reserved. |
SPACE |
A place where people send messages, share files, and collaborate. A SPACE can include Chat apps. |
GROUP_CHAT |
Group conversations between 3 or more people. A GROUP_CHAT can include Chat apps. |
DIRECT_MESSAGE |
1:1 messages between two humans or a human and a Chat app. |
Type
Deprecated: Use SpaceType
instead.
Enums | |
---|---|
TYPE_UNSPECIFIED |
Reserved. |
ROOM |
Conversations between two or more humans. |
DM |
1:1 Direct Message between a human and a Chat app, where all messages are flat. Note that this doesn't include direct messages between two humans. |
SpaceBatchUpdatedEventData
Event payload for multiple updates to a space.
Event type: google.workspace.chat.space.v1.batchUpdated
Fields | |
---|---|
spaces[] |
A list of updated spaces. |
SpaceEvent
An event that represents a change or activity in a Google Chat space. To learn more, see Work with events from Google Chat.
Fields | |
---|---|
name |
Resource name of the space event. Format: |
event_time |
Time when the event occurred. |
event_type |
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 Supported event types for messages:
Supported event types for memberships:
Supported event types for reactions:
Supported event types about the space:
|
Union field
|
|
message_created_event_data |
Event payload for a new message. Event type: |
message_updated_event_data |
Event payload for an updated message. Event type: |
message_deleted_event_data |
Event payload for a deleted message. Event type: |
message_batch_created_event_data |
Event payload for multiple new messages. Event type: |
message_batch_updated_event_data |
Event payload for multiple updated messages. Event type: |
message_batch_deleted_event_data |
Event payload for multiple deleted messages. Event type: |
space_updated_event_data |
Event payload for a space update. Event type: |
space_batch_updated_event_data |
Event payload for multiple updates to a space. Event type: |
membership_created_event_data |
Event payload for a new membership. Event type: |
membership_updated_event_data |
Event payload for an updated membership. Event type: |
membership_deleted_event_data |
Event payload for a deleted membership. Event type: |
membership_batch_created_event_data |
Event payload for multiple new memberships. Event type: |
membership_batch_updated_event_data |
Event payload for multiple updated memberships. Event type: |
membership_batch_deleted_event_data |
Event payload for multiple deleted memberships. Event type: |
reaction_created_event_data |
Event payload for a new reaction. Event type: |
reaction_deleted_event_data |
Event payload for a deleted reaction. Event type: |
reaction_batch_created_event_data |
Event payload for multiple new reactions. Event type: |
reaction_batch_deleted_event_data |
Event payload for multiple deleted reactions. Event type: |
SpaceReadState
A user's read state within a space, used to identify read and unread messages.
Fields | |
---|---|
name |
Resource name of the space read state. Format: |
last_read_time |
Optional. The time when the user's space read state was updated. Usually this corresponds with either the timestamp of the last read message, or a timestamp specified by the user to mark the last read position in a space. |
SpaceUpdatedEventData
Event payload for an updated space.
Event type: google.workspace.chat.space.v1.updated
Fields | |
---|---|
space |
The updated space. |
Thread
A thread in a Google Chat space. For example usage, see Start or reply to a message thread.
If you specify a thread when creating a message, you can set the messageReplyOption
field to determine what happens if no matching thread is found.
Fields | |
---|---|
name |
Resource name of the thread. Example: |
thread_key |
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 |
ThreadReadState
A user's read state within a thread, used to identify read and unread messages.
Fields | |
---|---|
name |
Resource name of the thread read state. Format: |
last_read_time |
The time when the user's thread read state was updated. Usually this corresponds with the timestamp of the last read message in a thread. |
UpdateMembershipRequest
Request message for updating a membership.
Fields | |
---|---|
membership |
Required. The membership to update. Only fields specified by |
update_mask |
Required. The field paths to update. Separate multiple values with commas or use Currently supported field paths:
|
use_admin_access |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires the |
UpdateMessageRequest
Request to update a message.
Fields | |
---|---|
message |
Required. Message with fields updated. |
update_mask |
Required. The field paths to update. Separate multiple values with commas or use Currently supported field paths:
|
allow_missing |
Optional. If |
UpdateSpaceReadStateRequest
Request message for UpdateSpaceReadState API.
Fields | |
---|---|
space_read_state |
Required. The space read state and fields to update. Only supports updating read state for the calling user. To refer to the calling user, set one of the following:
Format: users/{user}/spaces/{space}/spaceReadState |
update_mask |
Required. The field paths to update. Currently supported field paths:
When the To mark the space as read, set |
UpdateSpaceRequest
A request to update a single space.
Fields | |
---|---|
space |
Required. Space with fields to be updated. |
update_mask |
Required. The updated field paths, comma separated if there are multiple. You can update the following fields for a space:
|
use_admin_access |
When The calling user must be a Google Workspace administrator with the manage chat and spaces conversations privilege. Requires the Some |
User
A user in Google Chat. When returned as an output from a request, if your Chat app authenticates as a user, the output for a User
resource only populates the user's name
and type
.
Fields | |
---|---|
name |
Resource name for a Google Chat Format: For
|
display_name |
Output only. The user's display name. |
domain_id |
Unique identifier of the user's Google Workspace domain. |
type |
User type. |
is_anonymous |
Output only. When |
Type
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default value for the enum. DO NOT USE. |
HUMAN |
Human user. |
BOT |
Chat app user. |
UserMentionMetadata
Annotation metadata for user mentions (@).
Fields | |
---|---|
user |
The user mentioned. |
type |
The type of user mention. |
Type
Enums | |
---|---|
TYPE_UNSPECIFIED |
Default value for the enum. Don't use. |
ADD |
Add user to space. |
MENTION |
Mention user in space. |
WidgetMarkup
A widget is a UI element that presents text and images.
Fields | |
---|---|
buttons[] |
A list of buttons. Buttons is also |
Union field data . A WidgetMarkup can only have one of the following items. You can use multiple WidgetMarkup fields to display more items. data can be only one of the following: |
|
text_paragraph |
Display a text paragraph in this widget. |
image |
Display an image in this widget. |
key_value |
Display a key value item in this widget. |
Button
A button. Can be a text button or an image button.
Fields | |
---|---|
Union field
|
|
text_button |
A button with text and |
image_button |
A button with image and |
FormAction
A form action describes the behavior when the form is submitted. For example, you can invoke Apps Script to handle the form.
Fields | |
---|---|
action_method_name |
The method name is used to identify which part of the form triggered the form submission. This information is echoed back to the Chat app as part of the card click event. You can use the same method name for several elements that trigger a common behavior. |
parameters[] |
List of action parameters. |
ActionParameter
List of string parameters to supply when the action method is invoked. For example, consider three snooze buttons: snooze now, snooze one day, snooze next week. You might use action method = snooze()
, passing the snooze type and snooze time in the list of string parameters.
Fields | |
---|---|
key |
The name of the parameter for the action script. |
value |
The value of the parameter. |
Icon
The set of supported icons.
Enums | |
---|---|
ICON_UNSPECIFIED |
|
AIRPLANE |
|
BOOKMARK |
|
BUS |
|
CAR |
|
CLOCK |
|
CONFIRMATION_NUMBER_ICON |
|
DOLLAR |
|
DESCRIPTION |
|
EMAIL |
|
EVENT_PERFORMER |
|
EVENT_SEAT |
|
FLIGHT_ARRIVAL |
|
FLIGHT_DEPARTURE |
|
HOTEL |
|
HOTEL_ROOM_TYPE |
|
INVITE |
|
MAP_PIN |
|
MEMBERSHIP |
|
MULTIPLE_PEOPLE |
|
OFFER |
|
PERSON |
|
PHONE |
|
RESTAURANT_ICON |
|
SHOPPING_CART |
|
STAR |
|
STORE |
|
TICKET |
|
TRAIN |
|
VIDEO_CAMERA |
|
VIDEO_PLAY |
Image
An image that's specified by a URL and can have an onclick
action.
Fields | |
---|---|
image_url |
The URL of the image. |
on_click |
The |
aspect_ratio |
The aspect ratio of this image (width and height). This field lets you reserve the right height for the image while waiting for it to load. It's not meant to override the built-in aspect ratio of the image. If unset, the server fills it by prefetching the image. |
ImageButton
An image button with an onclick
action.
Fields | |
---|---|
on_click |
The |
name |
The name of this |
Union field icons . The icon can be specified by an Icon enum or a URL. icons can be only one of the following: |
|
icon |
The icon specified by an |
icon_url |
The icon specified by a URL. |
KeyValue
A UI element contains a key (label) and a value (content). This element can also contain some actions such as onclick
button.
Fields | |
---|---|
top_label |
The text of the top label. Formatted text supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons. |
content |
The text of the content. Formatted text supported and always required. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons. |
content_multiline |
If the content should be multiline. |
bottom_label |
The text of the bottom label. Formatted text supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons. |
on_click |
The |
Union field icons . At least one of icons, top_label and bottom_label must be defined. icons can be only one of the following: |
|
icon |
An enum value that's replaced by the Chat API with the corresponding icon image. |
icon_url |
The icon specified by a URL. |
Union field control . A control widget. You can set either button or switch_widget , but not both. control can be only one of the following: |
|
button |
A button that can be clicked to trigger an action. |
OnClick
An onclick
action (for example, open a link).
Fields | |
---|---|
Union field
|
|
action |
A form action is triggered by this |
open_link |
This |
OpenLink
A link that opens a new window.
Fields | |
---|---|
url |
The URL to open. |
TextButton
A button with text and onclick
action.
Fields | |
---|---|
text |
The text of the button. |
on_click |
The |
TextParagraph
A paragraph of text. Formatted text supported. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.
Fields | |
---|---|
text |
|