{"openapi":"3.1.0","info":{"title":"AAuth for Messages","version":"v1+v1","description":"Gmail and Google Chat for your AI assistant: find and read email, draft replies, send email you approve, label and archive, set your vacation responder and filters, and read, search and send Google Chat messages.","x-discovery-revision":"Gmail API: 20261026; Google Chat API: 20261026","x-upstream":["https://gmail.googleapis.com/","https://chat.googleapis.com/"]},"servers":[{"url":"https://messages.connect.aauth.dev"}],"paths":{"/threads/{id}":{"get":{"operationId":"get_thread","x-google-operation":"gmail.users.threads.get","summary":"Gets the specified thread. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).","description":"Gets the specified thread. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).","parameters":[{"name":"id","in":"path","description":"The ID of the thread to retrieve.","required":true,"schema":{"type":"string"}},{"name":"metadataHeaders","in":"query","description":"When given and format is METADATA, only include headers specified.","required":false,"schema":{"type":"array","items":{"type":"string"}},"explode":true},{"name":"format","in":"query","description":"The format to return the messages in.","required":false,"schema":{"type":"string","enum":["full","metadata","minimal"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.readonly"]}]}},"/threads/{id}/labels":{"post":{"operationId":"label_thread","x-google-operation":"gmail.users.threads.modify","summary":"Modifies the labels applied to the thread. This applies to all messages in the thread. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).","description":"Modifies the labels applied to the thread. This applies to all messages in the thread. For more information, see [Manage threads](https://developers.google.com/workspace/gmail/api/guides/threads).","parameters":[{"name":"id","in":"path","description":"The ID of the thread to modify.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyThreadRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.modify"]}],"x-aauth-access-mode":"auth-token"}},"/labels":{"post":{"operationId":"create_label","x-google-operation":"gmail.users.labels.create","summary":"Creates a label. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","description":"Creates a label. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.labels"]}],"x-aauth-access-mode":"auth-token"},"get":{"operationId":"list_labels","x-google-operation":"gmail.users.labels.list","summary":"Lists all labels in the user's mailbox. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","description":"Lists all labels in the user's mailbox. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLabelsResponse"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.labels"]}]}},"/labels/{id}":{"delete":{"operationId":"delete_label","x-google-operation":"gmail.users.labels.delete","summary":"Immediately and permanently deletes the specified label and removes it from any messages and threads that it's applied to. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","description":"Immediately and permanently deletes the specified label and removes it from any messages and threads that it's applied to. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","parameters":[{"name":"id","in":"path","description":"The ID of the label to delete.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.labels"]}],"x-aauth-access-mode":"auth-token"},"patch":{"operationId":"update_label","x-google-operation":"gmail.users.labels.patch","summary":"Patch the specified label. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","description":"Patch the specified label. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","parameters":[{"name":"id","in":"path","description":"The ID of the label to update.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.labels"]}],"x-aauth-access-mode":"auth-token"},"get":{"operationId":"get_label","x-google-operation":"gmail.users.labels.get","summary":"Gets the specified label. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","description":"Gets the specified label. For more information, see [Manage labels](https://developers.google.com/workspace/gmail/api/guides/labels).","parameters":[{"name":"id","in":"path","description":"The ID of the label to retrieve.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Label"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.labels"]}]}},"/drafts":{"get":{"operationId":"list_drafts","x-google-operation":"gmail.users.drafts.list","summary":"Lists the drafts in the user's mailbox. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","description":"Lists the drafts in the user's mailbox. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","parameters":[{"name":"maxResults","in":"query","description":"Maximum number of drafts to return. This field defaults to 100. The maximum allowed value for this field is 500.","required":false,"schema":{"type":"integer","format":"uint32"}},{"name":"includeSpamTrash","in":"query","description":"Include drafts from `SPAM` and `TRASH` in the results.","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","description":"Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, `\"from:someuser@example.com rfc822msgid: is:unread\"`.","required":false,"schema":{"type":"string"}},{"name":"pageToken","in":"query","description":"Page token to retrieve a specific page of results in the list.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListDraftsResponse"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.readonly"]}]},"post":{"operationId":"create_draft","x-google-operation":"gmail.users.drafts.create","summary":"Creates a draft with the `DRAFT` label. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","description":"Creates a draft with the `DRAFT` label. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.compose"]}],"x-aauth-access-mode":"auth-token"}},"/drafts/send":{"post":{"operationId":"send_draft","x-google-operation":"gmail.users.drafts.send","summary":"Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","description":"Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.compose"]}],"x-aauth-access-mode":"per-call"}},"/drafts/{id}":{"delete":{"operationId":"delete_draft","x-google-operation":"gmail.users.drafts.delete","summary":"Immediately and permanently deletes the specified draft. Does not simply trash it. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","description":"Immediately and permanently deletes the specified draft. Does not simply trash it. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","parameters":[{"name":"id","in":"path","description":"The ID of the draft to delete.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.compose"]}],"x-aauth-access-mode":"auth-token"},"put":{"operationId":"update_draft","x-google-operation":"gmail.users.drafts.update","summary":"Replaces a draft's content. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","description":"Replaces a draft's content. For more information, see [Create and send draft emails](https://developers.google.com/workspace/gmail/api/guides/drafts).","parameters":[{"name":"id","in":"path","description":"The ID of the draft to update.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Draft"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.compose"]}],"x-aauth-access-mode":"auth-token"}},"/messages":{"get":{"operationId":"search_messages","x-google-operation":"gmail.users.messages.list","summary":"Lists the messages in the user's mailbox. For more information, see [List Gmail messages](https://developers.google.com/workspace/gmail/api/guides/list-messages).","description":"Lists the messages in the user's mailbox. For more information, see [List Gmail messages](https://developers.google.com/workspace/gmail/api/guides/list-messages).","parameters":[{"name":"q","in":"query","description":"Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `\"from:someuser@example.com rfc822msgid: is:unread\"`. Parameter cannot be used when accessing the api using the gmail.metadata scope.","required":false,"schema":{"type":"string"}},{"name":"maxResults","in":"query","description":"Maximum number of messages to return. This field defaults to 100. The maximum allowed value for this field is 500.","required":false,"schema":{"type":"integer","format":"uint32"}},{"name":"includeSpamTrash","in":"query","description":"Include messages from `SPAM` and `TRASH` in the results.","required":false,"schema":{"type":"boolean"}},{"name":"pageToken","in":"query","description":"Page token to retrieve a specific page of results in the list.","required":false,"schema":{"type":"string"}},{"name":"labelIds","in":"query","description":"Only return messages with labels that match all of the specified label IDs. Messages in a thread might have labels that other messages in the same thread don't have. To learn more, see [Manage labels on messages and threads](https://developers.google.com/workspace/gmail/api/guides/labels#manage_labels_on_messages_threads).","required":false,"schema":{"type":"array","items":{"type":"string"}},"explode":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMessagesResponse"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.readonly"]}]}},"/messages/{id}/trash":{"post":{"operationId":"trash_message","x-google-operation":"gmail.users.messages.trash","summary":"Moves the specified message to the trash.","description":"Moves the specified message to the trash.","parameters":[{"name":"id","in":"path","description":"The ID of the message to Trash.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.modify"]}],"x-aauth-access-mode":"auth-token"}},"/messages/{id}/untrash":{"post":{"operationId":"untrash_message","x-google-operation":"gmail.users.messages.untrash","summary":"Removes the specified message from the trash.","description":"Removes the specified message from the trash.","parameters":[{"name":"id","in":"path","description":"The ID of the message to remove from Trash.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.modify"]}],"x-aauth-access-mode":"auth-token"}},"/messages/send":{"post":{"operationId":"send_message","x-google-operation":"gmail.users.messages.send","summary":"Sends the specified message to the recipients in the `To`, `Cc`, and `Bcc` headers. For more information, see [Create and send email messages](https://developers.google.com/workspace/gmail/api/guides/sending).","description":"Sends the specified message to the recipients in the `To`, `Cc`, and `Bcc` headers. For more information, see [Create and send email messages](https://developers.google.com/workspace/gmail/api/guides/sending).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.send"]}],"x-aauth-access-mode":"per-call"}},"/messages/{id}/labels":{"post":{"operationId":"label_message","x-google-operation":"gmail.users.messages.modify","summary":"Modifies the labels and the Classification Label values on the specified message. For administrators modifying message for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.modify.restricted` scope.","description":"Modifies the labels and the Classification Label values on the specified message. For administrators modifying message for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.modify.restricted` scope.","parameters":[{"name":"id","in":"path","description":"The ID of the message to modify.","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyMessageRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.modify"]}],"x-aauth-access-mode":"auth-token"}},"/messages/{id}":{"get":{"operationId":"get_message","x-google-operation":"gmail.users.messages.get","summary":"Gets the specified message.","description":"Gets the specified message.","parameters":[{"name":"id","in":"path","description":"The ID of the message to retrieve. This ID is usually retrieved using `messages.list`. The ID is also contained in the result when a message is inserted (`messages.insert`) or imported (`messages.import`).","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"The format to return the message in.","required":false,"schema":{"type":"string","enum":["minimal","full","raw","metadata"]}},{"name":"metadataHeaders","in":"query","description":"When given and format is `METADATA`, only include headers specified.","required":false,"schema":{"type":"array","items":{"type":"string"}},"explode":true}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.readonly"]}]}},"/messages/{messageId}/attachments/{id}":{"get":{"operationId":"get_attachment","x-google-operation":"gmail.users.messages.attachments.get","summary":"Gets the specified message attachment.","description":"Gets the specified message attachment.","parameters":[{"name":"messageId","in":"path","description":"The ID of the message containing the attachment.","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The ID of the attachment.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePartBody"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.readonly"]}]}},"/settings/vacation":{"get":{"operationId":"get_vacation_responder","x-google-operation":"gmail.users.settings.getVacation","summary":"Gets vacation responder settings. For more information, see [Manage vacation settings with the Gmail API](https://developers.google.com/workspace/gmail/api/guides/vacation_settings).","description":"Gets vacation responder settings. For more information, see [Manage vacation settings with the Gmail API](https://developers.google.com/workspace/gmail/api/guides/vacation_settings).","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VacationSettings"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.readonly"]}]},"put":{"operationId":"set_vacation_responder","x-google-operation":"gmail.users.settings.updateVacation","summary":"Updates vacation responder settings. For more information, see [Manage vacation settings with the Gmail API](https://developers.google.com/workspace/gmail/api/guides/vacation_settings).","description":"Updates vacation responder settings. For more information, see [Manage vacation settings with the Gmail API](https://developers.google.com/workspace/gmail/api/guides/vacation_settings).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VacationSettings"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VacationSettings"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.settings.basic"]}],"x-aauth-access-mode":"per-call"}},"/filters":{"post":{"operationId":"create_filter","x-google-operation":"gmail.users.settings.filters.create","summary":"Creates a filter. Note: you can only create a maximum of 1,000 filters. For more information, see [Manage Gmail filters](https://developers.google.com/workspace/gmail/api/guides/filter_settings).","description":"Creates a filter. Note: you can only create a maximum of 1,000 filters. For more information, see [Manage Gmail filters](https://developers.google.com/workspace/gmail/api/guides/filter_settings).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Filter"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Filter"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.settings.basic"]}],"x-aauth-access-mode":"per-call"},"get":{"operationId":"list_filters","x-google-operation":"gmail.users.settings.filters.list","summary":"Lists the message filters of a Gmail user. For more information, see [Manage Gmail filters](https://developers.google.com/workspace/gmail/api/guides/filter_settings).","description":"Lists the message filters of a Gmail user. For more information, see [Manage Gmail filters](https://developers.google.com/workspace/gmail/api/guides/filter_settings).","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListFiltersResponse"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.readonly"]}]}},"/filters/{id}":{"delete":{"operationId":"delete_filter","x-google-operation":"gmail.users.settings.filters.delete","summary":"Immediately and permanently deletes the specified filter. For more information, see [Manage Gmail filters](https://developers.google.com/workspace/gmail/api/guides/filter_settings).","description":"Immediately and permanently deletes the specified filter. For more information, see [Manage Gmail filters](https://developers.google.com/workspace/gmail/api/guides/filter_settings).","parameters":[{"name":"id","in":"path","description":"The ID of the filter to be deleted.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response"}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/gmail.settings.basic"]}],"x-aauth-access-mode":"auth-token"}},"/spaces/{spacesId}/read-state":{"get":{"operationId":"get_chat_read_state","x-google-operation":"chat.users.spaces.getSpaceReadState","summary":"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](https://developers.google.com/workspace/chat/get-space-read-state). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - `https://www.googleapis.com/auth/chat.users.readstate`","description":"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](https://developers.google.com/workspace/chat/get-space-read-state). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - `https://www.googleapis.com/auth/chat.users.readstate`","parameters":[{"name":"spacesId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSpaceReadState"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.users.readstate.readonly"]}]}},"/spaces":{"post":{"operationId":"create_chat_space","x-google-operation":"chat.spaces.setup","summary":"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](https://developers.google.com/workspace/chat/set-up-spaces). To specify the human members to add, add memberships with the appropriate `membership.member.name`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. To specify the Google groups to add, add memberships with the appropriate `membership.group_member.name`. To add or invite a Google group, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group@example.com`, then you can add the group to the space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces. 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 `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [Invite or add a user or app to a space](https://developers.google.com/workspace/chat/create-members). 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 `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.spaces.create` - `https://www.googleapis.com/auth/chat.spaces`","description":"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](https://developers.google.com/workspace/chat/set-up-spaces). To specify the human members to add, add memberships with the appropriate `membership.member.name`. To add a human user, use `users/{user}`, where `{user}` can be the email address for the user. For users in the same Workspace organization `{user}` can also be the `id` for the person from the People API, or the `id` for the user in the Directory API. For example, if the People API Person profile ID for `user@example.com` is `123456789`, you can add the user to the space by setting the `membership.member.name` to `users/user@example.com` or `users/123456789`. To specify the Google groups to add, add memberships with the appropriate `membership.group_member.name`. To add or invite a Google group, use `groups/{group}`, where `{group}` is the `id` for the group from the Cloud Identity Groups API. For example, you can use [Cloud Identity Groups lookup API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup) to retrieve the ID `123456789` for group email `group@example.com`, then you can add the group to the space by setting the `membership.group_member.name` to `groups/123456789`. Group email is not supported, and Google groups can only be added as members in named spaces. 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 `Space.singleUserBotDm` to `true` and don't specify any memberships. You can only use this method to set up a DM with the calling app. To add the calling app as a member of a space or an existing DM between two human users, see [Invite or add a user or app to a space](https://developers.google.com/workspace/chat/create-members). 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 `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.spaces.create` - `https://www.googleapis.com/auth/chat.spaces`","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSetUpSpaceRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSpace"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.spaces.create"]}],"x-aauth-access-mode":"auth-token"},"get":{"operationId":"list_spaces","x-google-operation":"chat.spaces.list","summary":"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](https://developers.google.com/workspace/chat/list-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces` To list all named spaces by Google Workspace organization, use the [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) method using Workspace administrator privileges instead.","description":"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](https://developers.google.com/workspace/chat/list-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces` To list all named spaces by Google Workspace organization, use the [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search) method using Workspace administrator privileges instead.","parameters":[{"name":"pageToken","in":"query","description":"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.","required":false,"schema":{"type":"string"}},{"name":"pageSize","in":"query","description":"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 `INVALID_ARGUMENT` error.","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"filter","in":"query","description":"Optional. A query filter. You can filter spaces by the space type ([`space_type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype)). To filter by space type, you must specify valid enum value, such as `SPACE` or `GROUP_CHAT` (the `space_type` can't be `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR` operator. For example, the following queries are valid: ``` space_type = \"SPACE\" spaceType = \"GROUP_CHAT\" OR spaceType = \"DIRECT_MESSAGE\" ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatListSpacesResponse"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.spaces.readonly"]}]}},"/spaces/{spacesId}":{"get":{"operationId":"get_space","x-google-operation":"chat.spaces.get","summary":"Returns details about a space. For an example, see [Get details about a space](https://developers.google.com/workspace/chat/get-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.bot` - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator approval](https://support.google.com/a?p=chat-app-auth) - [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` - User authentication grants administrator privileges when an administrator account authenticates, `use_admin_access` is `true`, and one of the following authorization scopes is used: - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - `https://www.googleapis.com/auth/chat.admin.spaces` App authentication has the following limitations: - `space.access_settings` is only populated when using the `chat.app.spaces` scope. - `space.predefind_permission_settings` and `space.permission_settings` are only populated when using the `chat.app.spaces` scope, and only for spaces the app created.","description":"Returns details about a space. For an example, see [Get details about a space](https://developers.google.com/workspace/chat/get-spaces). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.bot` - `https://www.googleapis.com/auth/chat.app.spaces` with [administrator approval](https://support.google.com/a?p=chat-app-auth) - [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` - User authentication grants administrator privileges when an administrator account authenticates, `use_admin_access` is `true`, and one of the following authorization scopes is used: - `https://www.googleapis.com/auth/chat.admin.spaces.readonly` - `https://www.googleapis.com/auth/chat.admin.spaces` App authentication has the following limitations: - `space.access_settings` is only populated when using the `chat.app.spaces` scope. - `space.predefind_permission_settings` and `space.permission_settings` are only populated when using the `chat.app.spaces` scope, and only for spaces the app created.","parameters":[{"name":"spacesId","in":"path","required":true,"schema":{"type":"string"}},{"name":"useAdminAccess","in":"query","description":"Optional. When `true`, the method runs using the user's Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with the [manage chat and spaces conversations privilege](https://support.google.com/a/answer/13369245). Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0 scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSpace"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.spaces.readonly"]}]}},"/spaces/direct-message":{"get":{"operationId":"find_direct_message","x-google-operation":"chat.spaces.findDirectMessage","summary":"Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), returns the direct message space between the specified user and the calling Chat app. With [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), returns the direct message space between the specified user and the authenticated user. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces`","description":"Returns the existing direct message with the specified user. If no direct message space is found, returns a `404 NOT_FOUND` error. For an example, see [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message). With [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app), returns the direct message space between the specified user and the calling Chat app. With [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), returns the direct message space between the specified user and the authenticated user. Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces`","parameters":[{"name":"name","in":"query","description":"Required. Resource name of the user to find direct message with. Format: `users/{user}`, where `{user}` is either the `id` for the [person](https://developers.google.com/people/api/rest/v1/people) from the People API, or the `id` for the [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) in the Directory API. For example, if the People API profile ID is `123456789`, you can find a direct message with that person by using `users/123456789` as the `name`. When [authenticated as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), you can use the email as an alias for `{user}`. For example, `users/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSpace"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.spaces.readonly"]}]}},"/spaces/{spacesId}/messages/{messagesId}":{"patch":{"operationId":"update_chat_message","x-google-operation":"chat.spaces.messages.patch","summary":"Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/workspace/chat/update-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app.","description":"Updates a message. There's a difference between the `patch` and `update` methods. The `patch` method uses a `patch` request while the `update` method uses a `put` request. We recommend using the `patch` method. For an example, see [Update a message](https://developers.google.com/workspace/chat/update-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) When using app authentication, requests can only update messages created by the calling Chat app.","parameters":[{"name":"spacesId","in":"path","required":true,"schema":{"type":"string"}},{"name":"messagesId","in":"path","required":true,"schema":{"type":"string"}},{"name":"allowMissing","in":"query","description":"Optional. If `true` and the message isn't found, a new message is created and `updateMask` is ignored. The specified message ID must be [client-assigned](https://developers.google.com/workspace/chat/create-messages#name_a_created_message) or the request fails.","required":false,"schema":{"type":"boolean"}},{"name":"updateMask","in":"query","description":"Required. The field paths to update. Separate multiple values with commas or use `*` to update all field paths. Currently supported field paths: - `text` - `attachment` - `cards` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `cards_v2` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `accessory_widgets` (Requires [app authentication](/chat/api/guides/auth/service-accounts).) - `quoted_message_metadata` (Only allows removal of the quoted message.)","required":false,"schema":{"type":"string","format":"google-fieldmask"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.messages"]}],"x-aauth-access-mode":"auth-token"},"delete":{"operationId":"delete_chat_message","x-google-operation":"chat.spaces.messages.delete","summary":"Deletes a message. For an example, see [Delete a message](https://developers.google.com/workspace/chat/delete-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) When using app authentication, requests can only delete messages created by the calling Chat app.","description":"Deletes a message. For an example, see [Delete a message](https://developers.google.com/workspace/chat/delete-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) When using app authentication, requests can only delete messages created by the calling Chat app.","parameters":[{"name":"spacesId","in":"path","required":true,"schema":{"type":"string"}},{"name":"messagesId","in":"path","required":true,"schema":{"type":"string"}},{"name":"force","in":"query","description":"Optional. When `true`, deleting a message also deletes its threaded replies. When `false`, if a message has threaded replies, deletion fails. Only applies when [authenticating as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). Has no effect when [authenticating as a Chat app] (https://developers.google.com/workspace/chat/authenticate-authorize-chat-app).","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatEmpty"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.messages"]}],"x-aauth-access-mode":"per-call"},"get":{"operationId":"get_chat_message","x-google-operation":"chat.spaces.messages.get","summary":"Returns details about a message. For an example, see [Get details about a message](https://developers.google.com/workspace/chat/get-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.bot`: When using this authorization scope, this method returns details about a message the Chat app has access to, like direct messages and [slash commands](https://developers.google.com/workspace/chat/slash-commands) that invoke the Chat app. - `https://www.googleapis.com/auth/chat.app.messages.readonly` with [administrator approval](https://support.google.com/a?p=chat-app-auth). When using this authentication scope, this method returns details about a public message in a space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages.readonly` - `https://www.googleapis.com/auth/chat.messages` Note: Might return a message from a blocked member or space.","description":"Returns details about a message. For an example, see [Get details about a message](https://developers.google.com/workspace/chat/get-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.bot`: When using this authorization scope, this method returns details about a message the Chat app has access to, like direct messages and [slash commands](https://developers.google.com/workspace/chat/slash-commands) that invoke the Chat app. - `https://www.googleapis.com/auth/chat.app.messages.readonly` with [administrator approval](https://support.google.com/a?p=chat-app-auth). When using this authentication scope, this method returns details about a public message in a space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages.readonly` - `https://www.googleapis.com/auth/chat.messages` Note: Might return a message from a blocked member or space.","parameters":[{"name":"spacesId","in":"path","required":true,"schema":{"type":"string"}},{"name":"messagesId","in":"path","required":true,"schema":{"type":"string"}},{"name":"markupSyntax","in":"query","description":"Optional. Specifies the desired output syntax for the Chat message `formatted_text` field.","required":false,"schema":{"type":"string","enum":["MARKUP_SYNTAX_UNSPECIFIED","MARKUP_SYNTAX_CHAT","MARKUP_SYNTAX_MARKDOWN"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.messages.readonly"]}]}},"/spaces/{spacesId}/messages":{"post":{"operationId":"send_chat_message","x-google-operation":"chat.spaces.messages.create","summary":"Creates a message in a Google Chat space. For an example, see [Send a message](https://developers.google.com/workspace/chat/create-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages.create` - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) Chat attributes the message sender differently depending on the type of authentication that you use in your request. 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 (`text`), cards (`cardsV2`), and accessory widgets (`accessoryWidgets`). ![Message sent with app authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg) 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 (`text`). ![Message sent with user authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) The maximum message size, including the message contents, is 32,000 bytes. For [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) requests, the response doesn't contain the full message. The response only populates the `name` and `thread.name` fields in addition to the information that was in the request.","description":"Creates a message in a Google Chat space. For an example, see [Send a message](https://developers.google.com/workspace/chat/create-messages). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with the authorization scope: - `https://www.googleapis.com/auth/chat.bot` - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages.create` - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only) Chat attributes the message sender differently depending on the type of authentication that you use in your request. 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 (`text`), cards (`cardsV2`), and accessory widgets (`accessoryWidgets`). ![Message sent with app authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg) 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 (`text`). ![Message sent with user authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg) The maximum message size, including the message contents, is 32,000 bytes. For [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks) requests, the response doesn't contain the full message. The response only populates the `name` and `thread.name` fields in addition to the information that was in the request.","parameters":[{"name":"spacesId","in":"path","required":true,"schema":{"type":"string"}},{"name":"messageId","in":"query","description":"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 `name` field). The value for this field must meet the following requirements: * Begins with `client-`. For example, `client-custom-name` is a valid custom ID, but `custom-name` is not. * Contains up to 63 characters and only lowercase letters, numbers, and hyphens. * Is unique within a space. A Chat app can't use the same custom ID for different messages. For details, see [Name a message](https://developers.google.com/workspace/chat/create-messages#name_a_created_message).","required":false,"schema":{"type":"string"}},{"name":"messageReplyOption","in":"query","description":"Optional. Specifies whether a message starts a thread or replies to one. Only supported in named spaces. When [responding to user interactions](https://developers.google.com/workspace/chat/receive-respond-interactions), this field is ignored. For interactions within a thread, the reply is created in the same thread. Otherwise, the reply is created as a new thread.","required":false,"schema":{"type":"string","enum":["MESSAGE_REPLY_OPTION_UNSPECIFIED","REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD","REPLY_MESSAGE_OR_FAIL"]}},{"name":"threadKey","in":"query","description":"Optional. Deprecated: Use thread.thread_key instead. ID for the thread. Supports up to 4000 characters. To start or add to a thread, create a message and specify a `threadKey` or the thread.name. For example usage, see [Start or reply to a message thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread).","required":false,"schema":{"type":"string"}},{"name":"requestId","in":"query","description":"Optional. A unique ID for this request. A random UUID is recommended. Specifying a request ID makes the request idempotent, which ensures that multiple identical requests with the same request ID result in only a single message being created. Subsequent requests with the same request ID return the existing message and do not update the message, even if the requested details differ from the current state. To use this field effectively: - Ensure that subsequent requests are identical and use the same authentication credentials as the original request. - If a message was already created with the provided request ID, the request returns that message. Note that the returned message might not be fully populated; the API echoes the message in your request with the system-assigned resource names populated. To retrieve the latest metadata for the message, call `GetMessage`. - Reusing an existing request ID with a different authenticated user results in an error.","required":false,"schema":{"type":"string"}},{"name":"createMessageNotificationOptions.notificationType","in":"query","description":"The notification type for the message.","required":false,"schema":{"type":"string","enum":["NOTIFICATION_TYPE_NONE","NOTIFICATION_TYPE_FORCE_NOTIFY","NOTIFICATION_TYPE_SILENT"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessage"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.messages"]}],"x-aauth-access-mode":"per-call"},"get":{"operationId":"list_chat_messages","x-google-operation":"chat.spaces.messages.list","summary":"Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. System messages, like those announcing new space members, aren't included. 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, `{}`. For an example, see [List messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the authorization scope: - `https://www.googleapis.com/auth/chat.app.messages.readonly`. When using this authentication scope, this method only returns public messages in a space. It doesn't include private messages. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages.readonly` - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only)","description":"Lists messages in a space that the caller is a member of, including messages from blocked members and spaces. System messages, like those announcing new space members, aren't included. 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, `{}`. For an example, see [List messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list). Supports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize): - [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) with the authorization scope: - `https://www.googleapis.com/auth/chat.app.messages.readonly`. When using this authentication scope, this method only returns public messages in a space. It doesn't include private messages. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes: - `https://www.googleapis.com/auth/chat.messages.readonly` - `https://www.googleapis.com/auth/chat.messages` - `https://www.googleapis.com/auth/chat.import` (import mode spaces only)","parameters":[{"name":"spacesId","in":"path","required":true,"schema":{"type":"string"}},{"name":"pageToken","in":"query","description":"Optional. 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.","required":false,"schema":{"type":"string"}},{"name":"showDeleted","in":"query","description":"Optional. Whether to include deleted messages. Deleted messages include deleted time and metadata about their deletion, but message content is unavailable.","required":false,"schema":{"type":"boolean"}},{"name":"pageSize","in":"query","description":"Optional. 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 `INVALID_ARGUMENT` error.","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"orderBy","in":"query","description":"Optional. How the list of messages is ordered. Specify a value to order by an ordering operation. Valid ordering operation values are as follows: - `ASC` for ascending. - `DESC` for descending. The default ordering is `create_time ASC`.","required":false,"schema":{"type":"string"}},{"name":"filter","in":"query","description":"Optional. A query filter. You can filter messages by date (`create_time`) and thread (`thread.name`). To filter messages by the date they were created, specify the `create_time` with a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and double quotation marks. For example, `\"2023-04-21T11:30:00-04:00\"`. You can use the greater than operator `>` to list messages that were created after a timestamp, or the less than operator `<` to list messages that were created before a timestamp. To filter messages within a time interval, use the `AND` operator between two timestamps. To filter by thread, specify the `thread.name`, formatted as `spaces/{space}/threads/{thread}`. You can only specify one `thread.name` per query. To filter by both thread and date, use the `AND` operator in your query. For example, the following queries are valid: ``` create_time > \"2012-04-21T11:30:00-04:00\" create_time > \"2012-04-21T11:30:00-04:00\" AND thread.name = spaces/AAAAAAAAAAA/threads/123 create_time > \"2012-04-21T11:30:00+00:00\" AND create_time < \"2013-01-01T00:00:00+00:00\" AND thread.name = spaces/AAAAAAAAAAA/threads/123 thread.name = spaces/AAAAAAAAAAA/threads/123 ``` Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error.","required":false,"schema":{"type":"string"}},{"name":"markupSyntax","in":"query","description":"Optional. Specifies the desired output syntax for the Chat message `formatted_text` field.","required":false,"schema":{"type":"string","enum":["MARKUP_SYNTAX_UNSPECIFIED","MARKUP_SYNTAX_CHAT","MARKUP_SYNTAX_MARKDOWN"]}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatListMessagesResponse"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.messages.readonly"]}]}},"/spaces/messages/search":{"post":{"operationId":"search_chat_messages","x-google-operation":"chat.spaces.messages.search","summary":"Searches for messages in Google Chat that the calling user has access to. Returns a list of messages matching the search criteria. To search across all spaces the user has access to, set `parent` to `spaces/-`. Using any other value for `parent` results in an `INVALID_ARGUMENT` error. The returned messages have their `name` field populated with the full resource name, which includes the specific `space` in which the message resides. This API doesn't return all message types. The types of messages listed below aren't included in the response. Use ListMessages to list all messages. - Private Messages that are visible to the authenticated user. - Messages posted by Chat apps in spaces or group chats. - Messages in a Chat app DM. - Messages from blocked users. - Messages in spaces that the caller has muted. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.messages.readonly` - `https://www.googleapis.com/auth/chat.messages`","description":"Searches for messages in Google Chat that the calling user has access to. Returns a list of messages matching the search criteria. To search across all spaces the user has access to, set `parent` to `spaces/-`. Using any other value for `parent` results in an `INVALID_ARGUMENT` error. The returned messages have their `name` field populated with the full resource name, which includes the specific `space` in which the message resides. This API doesn't return all message types. The types of messages listed below aren't included in the response. Use ListMessages to list all messages. - Private Messages that are visible to the authenticated user. - Messages posted by Chat apps in spaces or group chats. - Messages in a Chat app DM. - Messages from blocked users. - Messages in spaces that the caller has muted. Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.messages.readonly` - `https://www.googleapis.com/auth/chat.messages`","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSearchMessagesRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSearchMessagesResponse"}}}}},"security":[{"upstreamOAuth":["https://www.googleapis.com/auth/chat.messages.readonly"]}]}}},"components":{"schemas":{"ClassificationLabelFieldValue":{"type":"object","properties":{"fieldId":{"type":"string","description":"Required. The field ID for the Classification Label Value. Maps to the ID field of the Google Drive `Label.Field` object."},"selection":{"description":"Selection choice ID for the selection option. Should only be set if the field type is `SELECTION` in the Google Drive `Label.Field` object. Maps to the id field of the Google Drive `Label.Field.SelectionOptions` resource.","type":"string"}},"description":"Field values for a classification label."},"ClassificationLabelValue":{"description":"Classification Labels applied to the email message. Classification Labels are different from Gmail inbox labels. Only used for Google Workspace accounts. [Learn more about classification labels](https://support.google.com/a/answer/9292382).","type":"object","properties":{"labelId":{"description":"Required. The canonical or raw alphanumeric classification label ID. Maps to the ID field of the Google Drive Label resource.","type":"string"},"fields":{"description":"Field values for the given classification label ID.","type":"array","items":{"$ref":"#/components/schemas/ClassificationLabelFieldValue"}}}},"Draft":{"type":"object","properties":{"message":{"description":"The message content of the draft.","$ref":"#/components/schemas/Message"},"id":{"annotations":{"required":["gmail.users.drafts.send"]},"type":"string","description":"The immutable ID of the draft."}},"description":"A draft email in the user's mailbox."},"Filter":{"type":"object","description":"Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.","properties":{"id":{"description":"The server assigned ID of the filter.","type":"string"},"criteria":{"$ref":"#/components/schemas/FilterCriteria","description":"Matching criteria for the filter."},"action":{"description":"Action that the filter performs.","$ref":"#/components/schemas/FilterAction"}}},"FilterAction":{"properties":{"forward":{"type":"string","description":"Email address that the message should be forwarded to. This effectively redirects the message to the address specified in this field, maintaining the original sender in the \"From\" field."},"removeLabelIds":{"items":{"type":"string"},"type":"array","description":"List of labels to remove from the message."},"addLabelIds":{"items":{"type":"string"},"type":"array","description":"List of labels to add to the message."}},"description":"A set of actions to perform on a message.","type":"object"},"FilterCriteria":{"description":"Message matching criteria.","type":"object","properties":{"negatedQuery":{"description":"Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, `\"from:someuser@example.com rfc822msgid: is:unread\"`.","type":"string"},"to":{"type":"string","description":"The recipient's display name or email address. Includes recipients in the \"to\", \"cc\", and \"bcc\" header fields. You can use simply the local part of the email address. For example, \"example\" and \"example@\" both match \"example@gmail.com\". This field is case-insensitive."},"sizeComparison":{"description":"How the message size in bytes should be in relation to the size field.","type":"string","enum":["unspecified","smaller","larger"]},"from":{"description":"The sender's display name or email address.","type":"string"},"hasAttachment":{"description":"Whether the message has any attachment.","type":"boolean"},"excludeChats":{"type":"boolean","description":"Whether the response should exclude chats."},"size":{"description":"The size of the entire RFC822 message in bytes, including all headers and attachments.","type":"integer","format":"int32"},"query":{"description":"Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `\"from:someuser@example.com rfc822msgid: is:unread\"`.","type":"string"},"subject":{"description":"Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.","type":"string"}}},"Label":{"description":"Labels are used to categorize messages and threads within the user's mailbox. The maximum number of labels supported for a user's mailbox is 10,000.","properties":{"messagesTotal":{"type":"integer","description":"The total number of messages with the label.","format":"int32"},"threadsTotal":{"type":"integer","description":"The total number of threads with the label.","format":"int32"},"color":{"$ref":"#/components/schemas/LabelColor","description":"The color to assign to the label. Color is only available for labels that have their `type` set to `user`."},"type":{"type":"string","description":"The owner type for the label. User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread. System labels are internally created and cannot be added, modified, or deleted. System labels may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the `INBOX` and `UNREAD` labels from messages and threads, but cannot apply or remove the `DRAFTS` or `SENT` labels from messages or threads.","enum":["system","user"]},"messagesUnread":{"format":"int32","description":"The number of unread messages with the label.","type":"integer"},"labelListVisibility":{"enum":["labelShow","labelShowIfUnread","labelHide"],"description":"The visibility of the label in the label list in the Gmail web interface.","annotations":{"required":["gmail.users.labels.create","gmail.users.labels.update"]},"type":"string"},"id":{"annotations":{"required":["gmail.users.labels.update"]},"type":"string","description":"The immutable ID of the label."},"name":{"annotations":{"required":["gmail.users.labels.create","gmail.users.labels.update"]},"type":"string","description":"The display name of the label."},"threadsUnread":{"description":"The number of unread threads with the label.","format":"int32","type":"integer"},"messageListVisibility":{"enum":["show","hide"],"annotations":{"required":["gmail.users.labels.create","gmail.users.labels.update"]},"type":"string","description":"The visibility of messages with this label in the message list in the Gmail web interface."}},"type":"object"},"LabelColor":{"type":"object","properties":{"backgroundColor":{"description":"The background color represented as hex string #RRGGBB (ex #000000). This field is required in order to set the color of a label. Only the following predefined set of color values are allowed: \\#000000, #434343, #666666, #999999, #cccccc, #efefef, #f3f3f3, #ffffff, \\#fb4c2f, #ffad47, #fad165, #16a766, #43d692, #4a86e8, #a479e2, #f691b3, \\#f6c5be, #ffe6c7, #fef1d1, #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, \\#efa093, #ffd6a2, #fce8b3, #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, \\#e66550, #ffbc6b, #fcda83, #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, \\#cc3a21, #eaa041, #f2c960, #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, \\#ac2b16, #cf8933, #d5ae49, #0b804b, #2a9c68, #285bac, #653e9b, #b65775, \\#822111, #a46a21, #aa8831, #076239, #1a764d, #1c4587, #41236d, #83334c, \\#464646, #e7e7e7, #0d3472, #b6cff5, #0d3b44, #98d7e4, #3d188e, #e3d7ff, \\#711a36, #fbd3e0, #8a1c0a, #f2b2a8, #7a2e0b, #ffc8af, #7a4706, #ffdeb5, \\#594c05, #fbe983, #684e07, #fdedc1, #0b4f30, #b3efd3, #04502e, #a2dcc1, \\#c2c2c2, #4986e7, #2da2bb, #b99aff, #994a64, #f691b2, #ff7537, #ffad46, \\#662e37, #ebdbde, #cca6ac, #094228, #42d692, #16a765, #757575, #1e53b8, \\#007286, #7858c3, #c2185b, #d93025, #54240e, #633e04, #521d28, #202124, \\#083018","type":"string"},"textColor":{"type":"string","description":"The text color of the label, represented as hex string. This field is required in order to set the color of a label. Only the following predefined set of color values are allowed: \\#000000, #434343, #666666, #999999, #cccccc, #efefef, #f3f3f3, #ffffff, \\#fb4c2f, #ffad47, #fad165, #16a766, #43d692, #4a86e8, #a479e2, #f691b3, \\#f6c5be, #ffe6c7, #fef1d1, #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, \\#efa093, #ffd6a2, #fce8b3, #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, \\#e66550, #ffbc6b, #fcda83, #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, \\#cc3a21, #eaa041, #f2c960, #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, \\#ac2b16, #cf8933, #d5ae49, #0b804b, #2a9c68, #285bac, #653e9b, #b65775, \\#822111, #a46a21, #aa8831, #076239, #1a764d, #1c4587, #41236d, #83334c, \\#464646, #e7e7e7, #0d3472, #b6cff5, #0d3b44, #98d7e4, #3d188e, #e3d7ff, \\#711a36, #fbd3e0, #8a1c0a, #f2b2a8, #7a2e0b, #ffc8af, #7a4706, #ffdeb5, \\#594c05, #fbe983, #684e07, #fdedc1, #0b4f30, #b3efd3, #04502e, #a2dcc1, \\#c2c2c2, #4986e7, #2da2bb, #b99aff, #994a64, #f691b2, #ff7537, #ffad46, \\#662e37, #ebdbde, #cca6ac, #094228, #42d692, #16a765, #757575, #1e53b8, \\#007286, #7858c3, #c2185b, #d93025, #54240e, #633e04, #521d28, #202124, \\#083018"}}},"ListDraftsResponse":{"properties":{"nextPageToken":{"description":"Token to retrieve the next page of results in the list.","type":"string"},"resultSizeEstimate":{"description":"Estimated total number of results.","format":"uint32","type":"integer"},"drafts":{"description":"List of drafts. Note that the `Message` property in each `Draft` resource only contains an `id` and a `threadId`. The [`messages.get`](https://developers.google.com/workspace/gmail/api/v1/reference/users/messages/get) method can fetch additional message details.","items":{"$ref":"#/components/schemas/Draft"},"type":"array"}},"type":"object"},"ListFiltersResponse":{"type":"object","properties":{"filter":{"items":{"$ref":"#/components/schemas/Filter"},"type":"array","description":"List of a user's filters."}},"description":"Response for the ListFilters method."},"ListLabelsResponse":{"properties":{"labels":{"items":{"$ref":"#/components/schemas/Label"},"type":"array","description":"List of labels. Note that each label resource only contains an `id`, `name`, `messageListVisibility`, `labelListVisibility`, and `type`. The [`labels.get`](https://developers.google.com/workspace/gmail/api/v1/reference/users/labels/get) method can fetch additional label details."}},"type":"object"},"ListMessagesResponse":{"properties":{"nextPageToken":{"description":"Token to retrieve the next page of results in the list.","type":"string"},"messages":{"items":{"$ref":"#/components/schemas/Message"},"type":"array","description":"List of messages. Note that each message resource contains only an `id` and a `threadId`. Additional message details can be fetched using the messages.get method."},"resultSizeEstimate":{"type":"integer","format":"uint32","description":"Estimated total number of results."}},"type":"object"},"Message":{"type":"object","properties":{"internalDate":{"format":"int64","description":"The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the `Date` header. However, for API-migrated mail, it can be configured by client to be based on the `Date` header.","type":"string"},"classificationLabelValues":{"items":{"$ref":"#/components/schemas/ClassificationLabelValue"},"type":"array","description":"Classification Label values on the message. Available Classification Label schemas can be queried using the Google Drive Labels API. Each classification label ID must be unique. If duplicate IDs are provided, only one will be retained, and the selection is arbitrary. Only used for Google Workspace accounts. There's a limit of 20 Classification Label values per request. If the Classification Label values exceeds the maximum allowed number, the request fails."},"labelIds":{"description":"List of IDs of labels applied to this message.","items":{"type":"string"},"type":"array"},"snippet":{"type":"string","description":"A short part of the message text."},"sizeEstimate":{"format":"int32","type":"integer","description":"Estimated size in bytes of the message."},"historyId":{"format":"uint64","description":"The ID of the last history record that modified this message.","type":"string"},"payload":{"description":"The parsed email structure in the message parts.","$ref":"#/components/schemas/MessagePart"},"id":{"type":"string","description":"The immutable ID of the message."},"raw":{"type":"string","description":"The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in `messages.get` and `drafts.get` responses when the `format=RAW` parameter is supplied. @required gmail.users.drafts.create gmail.users.drafts.update","annotations":{"required":["gmail.users.messages.insert","gmail.users.messages.send"]},"format":"byte"},"threadId":{"type":"string","description":"The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. "}},"description":"An email message."},"MessagePart":{"description":"A single MIME message part.","properties":{"body":{"description":"The message part body for this part, which may be empty for container MIME message parts.","$ref":"#/components/schemas/MessagePartBody"},"headers":{"items":{"$ref":"#/components/schemas/MessagePartHeader"},"description":"List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as `To`, `From`, and `Subject`.","type":"array"},"filename":{"description":"The filename of the attachment. Only present if this message part represents an attachment.","type":"string"},"partId":{"description":"The immutable ID of the message part.","type":"string"},"mimeType":{"description":"The MIME type of the message part.","type":"string"},"parts":{"description":"The child MIME message parts of this part. This only applies to container MIME message parts, for example `multipart/*`. For non- container MIME message part types, such as `text/plain`, this field is empty. For more information, see RFC 1521.","items":{"$ref":"#/components/schemas/MessagePart"},"type":"array"}},"type":"object"},"MessagePartBody":{"description":"The body of a single MIME message part.","type":"object","properties":{"size":{"type":"integer","description":"Number of bytes for the message part data (encoding notwithstanding).","format":"int32"},"attachmentId":{"description":"When present, contains the ID of an external attachment that can be retrieved in a separate `messages.attachments.get` request. When not present, the entire content of the message part body is contained in the data field.","type":"string"},"data":{"type":"string","format":"byte","description":"The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment."}}},"MessagePartHeader":{"properties":{"value":{"type":"string","description":"The value of the header after the `:` separator. For example, `someuser@example.com`."},"name":{"description":"The name of the header before the `:` separator. For example, `To`.","type":"string"}},"type":"object"},"ModifyMessageRequest":{"type":"object","properties":{"addClassificationLabels":{"type":"array","description":"A list of classification label values to add. If a Classification Label with the same label ID is already applied to the message, fields with existing field IDs will be updated and fields with new field IDs will be added. There's a limit of 20 Classification Label values per request. If the message is already classified and the final total number of Classification Label values exceeds the maximum allowed number of Classification Label values per message, the modification fails.","items":{"$ref":"#/components/schemas/ClassificationLabelValue"}},"removeLabelIds":{"type":"array","description":"A list IDs of labels to remove from this message. You can remove up to 100 labels with each update.","items":{"type":"string"}},"removeClassificationLabelIds":{"type":"array","description":"A list of Classification Label values to remove from this message.","items":{"type":"string"}},"addLabelIds":{"type":"array","description":"A list of IDs of labels to add to this message. You can add up to 100 labels with each update.","items":{"type":"string"}}}},"ModifyThreadRequest":{"type":"object","properties":{"removeLabelIds":{"description":"A list of IDs of labels to remove from this thread. You can remove up to 100 labels with each update.","items":{"type":"string"},"type":"array"},"addLabelIds":{"items":{"type":"string"},"description":"A list of IDs of labels to add to this thread. You can add up to 100 labels with each update.","type":"array"}}},"Thread":{"properties":{"id":{"description":"The unique ID of the thread.","type":"string"},"snippet":{"type":"string","description":"A short part of the message text."},"historyId":{"type":"string","description":"The ID of the last history record that modified this thread.","format":"uint64"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/Message"},"description":"The list of messages in the thread."}},"description":"A collection of messages representing a conversation.","type":"object"},"VacationSettings":{"type":"object","description":"Vacation auto-reply settings for an account. These settings correspond to the \"Vacation responder\" feature in the web interface.","properties":{"enableAutoReply":{"description":"Flag that controls whether Gmail automatically replies to messages.","type":"boolean"},"responseBodyHtml":{"type":"string","description":"Response body in HTML format. Gmail will sanitize the HTML before storing it. If both `response_body_plain_text` and `response_body_html` are specified, `response_body_html` will be used."},"responseBodyPlainText":{"type":"string","description":"Response body in plain text format. If both `response_body_plain_text` and `response_body_html` are specified, `response_body_html` will be used."},"startTime":{"format":"int64","description":"An optional start time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives after the start time. If both `startTime` and `endTime` are specified, `startTime` must precede `endTime`.","type":"string"},"responseSubject":{"description":"Optional text to prepend to the subject line in vacation responses. In order to enable auto-replies, either the response subject or the response body must be nonempty.","type":"string"},"restrictToDomain":{"description":"Flag that determines whether responses are sent to recipients who are outside of the user's domain. This feature is only available for Google Workspace users.","type":"boolean"},"endTime":{"format":"int64","type":"string","description":"An optional end time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives before the end time. If both `startTime` and `endTime` are specified, `startTime` must precede `endTime`."},"restrictToContacts":{"type":"boolean","description":"Flag that determines whether responses are sent to recipients who are not in the user's list of contacts."}}},"ChatAccessPermissionSetting":{"type":"object","description":"An access permission setting.","properties":{"principals":{"items":{"$ref":"#/components/schemas/ChatPrincipal"},"description":"Optional. Unordered list. Allowed principals for this permission.","type":"array"}}},"ChatAccessPermissionSettings":{"type":"object","properties":{"viewSpaceMembershipSetting":{"description":"Optional. Access permission setting for viewing space membership. Must be specified together with `PermissionSettings.view_space_membership` in the update mask and request body when updating who can view space membership. When granting view access to a target audience, you must also grant `PermissionSettings.view_space_membership` to all members in the same request. To remove an existing target audience (for example, to restrict view access to space managers or assistant managers only), specify an empty `AccessPermissionSetting` (with no `principals`).","$ref":"#/components/schemas/ChatAccessPermissionSetting"},"joinSpaceSetting":{"$ref":"#/components/schemas/ChatAccessPermissionSetting","description":"Optional. Access permission setting for joining the space."},"discoverSpaceSetting":{"description":"Optional. Access permission setting for discovering the space.","$ref":"#/components/schemas/ChatAccessPermissionSetting"}},"description":"Access permission settings for a space."},"ChatAccessSettings":{"description":"Represents the [access setting](https://support.google.com/chat/answer/11971020) of the space.","type":"object","properties":{"accessState":{"readOnly":true,"enum":["ACCESS_STATE_UNSPECIFIED","PRIVATE","DISCOVERABLE"],"type":"string","description":"Output only. Indicates the access state of the space."},"accessPermissionSettings":{"description":"Optional. Access permission settings for the space. To set the target audience when creating a space, specify the `accessSettings.audience` field in your request.","$ref":"#/components/schemas/ChatAccessPermissionSettings"},"audience":{"description":"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).","type":"string"}}},"ChatAnnotation":{"description":"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. To add basic formatting to a text message, see [Format text messages](https://developers.google.com/workspace/chat/format-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\" } }] ```","type":"object","properties":{"type":{"description":"The type of this annotation.","type":"string","enum":["ANNOTATION_TYPE_UNSPECIFIED","USER_MENTION","SLASH_COMMAND","RICH_LINK","CUSTOM_EMOJI"]},"slashCommand":{"description":"The metadata for a slash command.","$ref":"#/components/schemas/ChatSlashCommandMetadata"},"userMention":{"description":"The metadata of user mention.","$ref":"#/components/schemas/ChatUserMentionMetadata"},"startIndex":{"format":"int32","type":"integer","description":"Start index (0-based, inclusive) in the plain-text message body this annotation corresponds to."},"customEmojiMetadata":{"description":"The metadata for a custom emoji.","$ref":"#/components/schemas/ChatCustomEmojiMetadata"},"length":{"format":"int32","description":"Length of the substring in the plain-text message body this annotation corresponds to. If not present, indicates a length of 0.","type":"integer"},"richLinkMetadata":{"description":"The metadata for a rich link.","$ref":"#/components/schemas/ChatRichLinkMetadata"}}},"ChatAttachedGif":{"type":"object","properties":{"uri":{"description":"Output only. The URL that hosts the GIF image.","type":"string","readOnly":true}},"description":"A GIF image that's specified by a URL."},"ChatAttachment":{"description":"An attachment in Google Chat.","type":"object","properties":{"contentType":{"type":"string","description":"Output only. The content type (MIME type) of the file.","readOnly":true},"downloadUri":{"description":"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.","type":"string","readOnly":true},"source":{"description":"Output only. The source of the attachment.","type":"string","readOnly":true,"enum":["SOURCE_UNSPECIFIED","DRIVE_FILE","UPLOADED_CONTENT"]},"name":{"description":"Identifier. Resource name of the attachment. Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.","type":"string"},"attachmentDataRef":{"description":"Optional. A reference to the attachment data. This field is used to create or update messages with attachments, or with the media API to download the attachment data.","$ref":"#/components/schemas/ChatAttachmentDataRef"},"contentName":{"description":"Output only. The original file name for the content, not the full path.","type":"string","readOnly":true},"driveDataRef":{"$ref":"#/components/schemas/ChatDriveDataRef","description":"Output only. A reference to the Google Drive attachment. This field is used with the Google Drive API.","readOnly":true},"thumbnailUri":{"type":"string","description":"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.","readOnly":true}}},"ChatAttachmentDataRef":{"description":"A reference to the attachment data.","type":"object","properties":{"resourceName":{"type":"string","description":"Optional. The resource name of the attachment data. This field is used with the media API to download the attachment data."},"attachmentUploadToken":{"description":"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.","type":"string"}}},"ChatAudience":{"type":"object","properties":{"name":{"description":"The resource name of the [target audience](https://support.google.com/a/answer/9934697) who can discover or join the space. 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`.","type":"string"}},"description":"A target audience in Google Chat. A target audience represents a group of users within a Google Workspace organization, defined by an administrator. Target audiences are used to configure access and visibility settings for resources, such as making a space discoverable to a specific group of users. For more details, see [Target audiences](https://support.google.com/a/answer/9934697) and [Make a space discoverable to a target audience](https://developers.google.com/workspace/chat/space-target-audience)."},"ChatCalendarEventLinkData":{"description":"Data for Calendar event links.","properties":{"calendarId":{"type":"string","description":"The [Calendar identifier](https://developers.google.com/workspace/calendar/api/v3/reference/calendars) of the linked Calendar."},"eventId":{"type":"string","description":"The [Event identifier](https://developers.google.com/workspace/calendar/api/v3/reference/events) of the linked Calendar event."}},"type":"object"},"ChatChatSpaceLinkData":{"properties":{"message":{"description":"The message of the linked Chat space resource. Format: `spaces/{space}/messages/{message}`","type":"string"},"thread":{"type":"string","description":"The thread of the linked Chat space resource. Format: `spaces/{space}/threads/{thread}`"},"space":{"description":"The space of the linked Chat space resource. Format: `spaces/{space}`","type":"string"}},"type":"object","description":"Data for Chat space links."},"ChatCitation":{"type":"object","properties":{"citedSources":{"description":"Optional. A list of sources that are relevant to the citation. Sources are displayed in the citation hover card.","type":"array","items":{"$ref":"#/components/schemas/ChatCitedSource"}},"id":{"description":"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.","type":"string"}},"description":"Citations are inline references that can provide users more detailed information about the inline reference. Corresponding inline citations should be present in the message text in a markup format of `{text}`. Citations are only supported when the message's `markup_syntax` is set to `MARKDOWN`. Unreferenced citations in `Elements.citations` (those without a matching `` tag in the message text) are ignored and do not cause the message to be rejected."},"ChatCitedSource":{"type":"object","description":"A reference to a source of information.","properties":{"snippet":{"$ref":"#/components/schemas/ChatSnippet","description":"Optional. Snippet containing information directly from the source."},"title":{"description":"Required. The plaintext title of the `CitedSource`. Does not support markdown format.","type":"string"},"uri":{"type":"string","description":"Required. The URI pointing to the resource referenced by this `CitedSource`."},"footer":{"$ref":"#/components/schemas/ChatFooter","description":"Optional. Additional information to show alongside the snippet in the form of a footer."}}},"ChatCustomEmoji":{"description":"Represents a [custom emoji](https://support.google.com/chat/answer/12800149).","type":"object","properties":{"uid":{"readOnly":true,"description":"Output only. Unique key for the custom emoji resource.","type":"string"},"emojiName":{"description":"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:`","type":"string"},"temporaryImageUri":{"description":"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.","readOnly":true,"type":"string"},"payload":{"description":"Optional. Input only. Payload data. Required when the custom emoji is created.","$ref":"#/components/schemas/ChatCustomEmojiPayload"},"name":{"type":"string","description":"Identifier. The resource name of the custom emoji, assigned by the server. Format: `customEmojis/{customEmoji}`"}}},"ChatCustomEmojiMetadata":{"properties":{"customEmoji":{"$ref":"#/components/schemas/ChatCustomEmoji","description":"The custom emoji."}},"description":"Annotation metadata for custom emoji.","type":"object"},"ChatCustomEmojiPayload":{"description":"Payload data for the custom emoji.","type":"object","properties":{"filename":{"type":"string","description":"Required. Input only. The image file name. Supported file extensions: `.png`, `.jpg`, `.gif`."},"fileContent":{"type":"string","format":"byte","description":"Required. Input only. The image used for the custom emoji. The payload must be under 256 KB and the dimension of the image must be square and between 64 and 500 pixels. The restrictions are subject to change."}}},"ChatDeletionMetadata":{"properties":{"deletionType":{"enum":["DELETION_TYPE_UNSPECIFIED","CREATOR","SPACE_OWNER","ADMIN","APP_MESSAGE_EXPIRY","CREATOR_VIA_APP","SPACE_OWNER_VIA_APP","SPACE_MEMBER"],"description":"Indicates who deleted the message.","type":"string"}},"type":"object","description":"Information about a deleted message. A message is deleted when `delete_time` is set."},"ChatDriveDataRef":{"description":"A reference to the data of a drive attachment.","type":"object","properties":{"driveFileId":{"type":"string","description":"The ID for the drive file. Use with the Drive API."}}},"ChatDriveLinkData":{"properties":{"driveDataRef":{"description":"A [DriveDataRef](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref) which references a Google Drive file.","$ref":"#/components/schemas/ChatDriveDataRef"},"mimeType":{"description":"The mime type of the linked Google Drive resource.","type":"string"}},"type":"object","description":"Data for Google Drive links."},"ChatElements":{"type":"object","properties":{"citedSources":{"type":"array","description":"Optional. A list of sources to be displayed under the message as footer links. These are not referenced inline. For inline references, use `citations`.","items":{"$ref":"#/components/schemas/ChatCitedSource"}},"citations":{"description":"Optional. A list of inline citations referenced within the message text (via `` tags) that render as interactive hover cards.","type":"array","items":{"$ref":"#/components/schemas/ChatCitation"}}},"description":"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."},"ChatElementsImage":{"description":"An object encapsulating different ways of representing an image. Currently supported representations: * An image fetched from a URI. Additional representations might be supported in the future.","type":"object","properties":{"imageUri":{"type":"string","description":"Required. The URI of the image. Must be a publicly accessible URI so that Chat can fetch and display it."}}},"ChatEmoji":{"description":"An emoji that is used as a reaction to a message.","type":"object","properties":{"customEmoji":{"description":"A custom emoji.","$ref":"#/components/schemas/ChatCustomEmoji"},"unicode":{"description":"Optional. A basic emoji represented by a unicode string.","type":"string"}}},"ChatEmojiReactionSummary":{"properties":{"emoji":{"$ref":"#/components/schemas/ChatEmoji","description":"Output only. Emoji associated with the reactions.","readOnly":true},"reactionCount":{"readOnly":true,"description":"Output only. The total number of reactions using the associated emoji.","format":"int32","type":"integer"}},"type":"object","description":"The number of people who reacted to a message with a specific emoji."},"ChatEmpty":{"type":"object","description":"A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }","properties":{}},"ChatFooter":{"properties":{"text":{"type":"string","description":"Optional. The plaintext to display in the footer. Does not support markdown format."}},"type":"object","description":"A footer for a source, used for attribution."},"ChatForwardedMetadata":{"type":"object","properties":{"space":{"description":"Output only. The resource name of the source space. Format: spaces/{space}","readOnly":true,"type":"string"},"spaceDisplayName":{"description":"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\").","type":"string","readOnly":true}},"description":"Metadata about the source space from which a message was forwarded."},"ChatGroup":{"properties":{"name":{"type":"string","description":"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}"}},"type":"object","description":"A Google Group in Google Chat."},"ChatListMessagesResponse":{"type":"object","description":"Response message for listing messages.","properties":{"messages":{"type":"array","description":"List of messages.","items":{"$ref":"#/components/schemas/ChatMessage"}},"nextPageToken":{"type":"string","description":"You can send a token as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages."}}},"ChatListSpacesResponse":{"description":"The response for a list spaces request.","properties":{"spaces":{"type":"array","description":"List of spaces in the requested (or first) page. Note: The `permissionSettings` field is not returned in the Space object for list requests.","items":{"$ref":"#/components/schemas/ChatSpace"}},"nextPageToken":{"description":"You can send a token as `pageToken` to retrieve the next page of results. If empty, there are no subsequent pages.","type":"string"}},"type":"object"},"ChatMatchedUrl":{"type":"object","description":"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).","properties":{"url":{"readOnly":true,"description":"Output only. The URL that was matched.","type":"string"}}},"ChatMeetSpaceLinkData":{"properties":{"huddleStatus":{"type":"string","enum":["HUDDLE_STATUS_UNSPECIFIED","STARTED","ENDED","MISSED"],"readOnly":true,"description":"Optional. Output only. If the Meet is a Huddle, indicates the status of the huddle. Otherwise, this is unset."},"type":{"type":"string","enum":["TYPE_UNSPECIFIED","MEETING","HUDDLE"],"description":"Indicates the type of the Meet space."},"meetingCode":{"type":"string","description":"Meeting code of the linked Meet space."}},"description":"Data for Meet space links.","type":"object"},"ChatMembership":{"properties":{"groupMember":{"$ref":"#/components/schemas/ChatGroup","description":"Optional. The Google Group the membership corresponds to. Reading or mutating memberships for Google Groups requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)."},"name":{"type":"string","description":"Identifier. Resource name of the membership, assigned by the server. Format: `spaces/{space}/members/{member}`"},"member":{"description":"Optional. The Google Chat user or app the membership corresponds to. If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output only populates the [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) `name` and `type` fields for both internal and external users, unless they are members of the space or have a prior affinity, like a direct message (DM) conversation, with the calling user.","$ref":"#/components/schemas/ChatUser"},"deleteTime":{"type":"string","description":"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.","format":"google-datetime"},"state":{"readOnly":true,"type":"string","enum":["MEMBERSHIP_STATE_UNSPECIFIED","JOINED","INVITED","NOT_A_MEMBER"],"description":"Output only. State of the membership."},"affiliation":{"enum":["AFFILIATION_UNSPECIFIED","INTERNAL","EXTERNAL","MANAGED_EXTERNAL"],"type":"string","readOnly":true,"description":"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`."},"role":{"description":"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`.","enum":["MEMBERSHIP_ROLE_UNSPECIFIED","ROLE_MEMBER","ROLE_MANAGER","ROLE_ASSISTANT_MANAGER"],"type":"string"},"createTime":{"format":"google-datetime","description":"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.","type":"string"}},"description":"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.","type":"object"},"ChatMembershipCount":{"description":"Represents the count of memberships of a space, grouped into categories.","type":"object","properties":{"joinedGroupCount":{"description":"Output only. Count of all groups that have directly joined the space.","readOnly":true,"format":"int32","type":"integer"},"joinedDirectHumanUserCount":{"description":"Output only. Count of human users that have directly joined the space, not counting users joined by having membership in a joined group.","format":"int32","readOnly":true,"type":"integer"}}},"ChatMessage":{"description":"A message in a Google Chat space.","properties":{"quotedMessageMetadata":{"$ref":"#/components/schemas/ChatQuotedMessageMetadata","description":"Optional. Information about a message that another message quotes. When you create a message, you can quote messages within the same thread, or quote a root message to create a new root message. However, you can't quote a message reply from a different thread. 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)."},"argumentText":{"readOnly":true,"description":"Output only. Plain-text body of the message with all Chat app mentions stripped out.","type":"string"},"matchedUrl":{"description":"Output only. A URL in the Chat message `text` field that matches a link preview pattern. For more information, see [Preview links](https://developers.google.com/workspace/chat/preview-links).","$ref":"#/components/schemas/ChatMatchedUrl","readOnly":true},"silent":{"type":"boolean","readOnly":true,"description":"Output only. Whether this is a silent message. Silent messages are messages where Chat suppresses push notifications for recipients."},"lastUpdateTime":{"readOnly":true,"description":"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.","format":"google-datetime","type":"string"},"deleteTime":{"type":"string","readOnly":true,"format":"google-datetime","description":"Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty."},"slashCommand":{"readOnly":true,"$ref":"#/components/schemas/ChatSlashCommand","description":"Output only. Slash command information, if applicable."},"createTime":{"type":"string","format":"google-datetime","description":"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."},"text":{"type":"string","description":"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)."},"emojiReactionSummaries":{"description":"Output only. The list of emoji reaction summaries on the message.","readOnly":true,"type":"array","items":{"$ref":"#/components/schemas/ChatEmojiReactionSummary"}},"attachment":{"type":"array","items":{"$ref":"#/components/schemas/ChatAttachment"},"description":"Optional. User-uploaded attachment."},"name":{"description":"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).","type":"string"},"elements":{"description":"Optional. 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). On input, provide `elements` when creating or updating a message. On output, both `citations` and `cited_sources` are populated when reading a message that contains them. Callers can read structured citation metadata from `elements`, while `formatted_text` also includes inline citation tags or source links depending on `markup_syntax`. These differ from `annotations`, which are output-only and offer supplementary information tied to message fragments or the entire message text.","$ref":"#/components/schemas/ChatElements"},"formattedText":{"readOnly":true,"description":"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)","type":"string"},"thread":{"$ref":"#/components/schemas/ChatThread","description":"The thread the message belongs to. For example usage, see [Start or reply to a message thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread)."},"threadReply":{"type":"boolean","readOnly":true,"description":"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`."},"markupSyntax":{"description":"Optional. Specifies how the server interprets the message `text` field content.","type":"string","enum":["MARKUP_SYNTAX_UNSPECIFIED","MARKUP_SYNTAX_CHAT","MARKUP_SYNTAX_MARKDOWN"]},"annotations":{"description":"Output only. Annotations can be associated with the plain-text body of the message or with chips that link to Google Workspace resources like Google Docs or Sheets with `start_index` and `length` of 0.","type":"array","items":{"$ref":"#/components/schemas/ChatAnnotation"},"readOnly":true},"deletionMetadata":{"readOnly":true,"description":"Output only. Information about a deleted message. A message is deleted when `delete_time` is set.","$ref":"#/components/schemas/ChatDeletionMetadata"},"fallbackText":{"type":"string","description":"Optional. A plain-text description of the message's cards, used when the actual cards can't be displayed—for example, mobile notifications."},"clientAssignedMessageId":{"description":"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).","type":"string"},"space":{"description":"Output only. If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output only populates the [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) `name`.","readOnly":true,"$ref":"#/components/schemas/ChatSpace"},"attachedGifs":{"type":"array","items":{"$ref":"#/components/schemas/ChatAttachedGif"},"readOnly":true,"description":"Output only. GIF images that are attached to the message."},"sender":{"readOnly":true,"description":"Output only. The user who created the message. If your Chat app [authenticates as a user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), the output only populates the [user](https://developers.google.com/workspace/chat/api/reference/rest/v1/User) `name` and `type` fields for both internal and external users, unless they are members of the space or have a prior affinity, like a direct message (DM) conversation, with the calling user.","$ref":"#/components/schemas/ChatUser"},"privateMessageViewer":{"description":"Optional. 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. To include this field in your request, you must call the Chat API using [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and omit the following: * [Attachments](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments) For details, see [Send a message privately](https://developers.google.com/workspace/chat/create-messages#private).","$ref":"#/components/schemas/ChatUser"}},"type":"object"},"ChatPermissionSetting":{"description":"Represents a space permission setting.","type":"object","properties":{"assistantManagersAllowed":{"description":"Optional. Whether space managers `ROLE_ASSISTANT_MANAGER`) have this permission.","type":"boolean"},"membersAllowed":{"type":"boolean","description":"Optional. Whether basic space members (`ROLE_MEMBER`) have this permission."},"managersAllowed":{"description":"Optional. Whether space owners (`ROLE_MANAGER`) have this permission.","type":"boolean"}}},"ChatPermissionSettings":{"properties":{"useAtMentionAll":{"$ref":"#/components/schemas/ChatPermissionSetting","description":"Optional. Setting for using @all in a space."},"toggleHistory":{"description":"Optional. Setting for toggling space history on and off.","$ref":"#/components/schemas/ChatPermissionSetting"},"manageWebhooks":{"$ref":"#/components/schemas/ChatPermissionSetting","description":"Optional. Setting for managing webhooks in a space."},"manageMembersAndGroups":{"$ref":"#/components/schemas/ChatPermissionSetting","description":"Optional. Setting for managing members and groups in a space."},"manageApps":{"description":"Optional. Setting for managing apps in a space.","$ref":"#/components/schemas/ChatPermissionSetting"},"replyMessages":{"description":"Optional. Setting for replying to messages in a space.","$ref":"#/components/schemas/ChatPermissionSetting"},"viewSpaceMembership":{"description":"Optional. Setting for viewing space membership. Must be specified together with `AccessPermissionSettings.view_space_membership_setting` in the update mask and request body when updating who can view space membership. When restricting view access to specific roles (for example, space managers or assistant managers only), specify the desired role permissions here and provide an empty `AccessPermissionSettings.view_space_membership_setting` in the same request. If a target audience is configured in `AccessPermissionSettings.view_space_membership_setting`, this setting must be granted to all members.","$ref":"#/components/schemas/ChatPermissionSetting"},"postMessages":{"description":"Output only. Setting for posting messages in a space.","readOnly":true,"$ref":"#/components/schemas/ChatPermissionSetting"},"modifySpaceDetails":{"$ref":"#/components/schemas/ChatPermissionSetting","description":"Optional. Setting for updating space name, avatar, description and guidelines."}},"description":"[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.","type":"object"},"ChatPrincipal":{"description":"A principal representing an entity granted access.","type":"object","properties":{"audience":{"$ref":"#/components/schemas/ChatAudience","description":"An audience."}}},"ChatQuotedMessageMetadata":{"properties":{"quoteType":{"description":"Optional. Specifies the quote type. If not set, defaults to REPLY in the message read/write path for backward compatibility.","enum":["QUOTE_TYPE_UNSPECIFIED","REPLY","FORWARD"],"type":"string"},"lastUpdateTime":{"type":"string","description":"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.","format":"google-datetime"},"forwardedMetadata":{"readOnly":true,"description":"Output only. Metadata about the source space of the quoted message. Populated only for FORWARD quote type.","$ref":"#/components/schemas/ChatForwardedMetadata"},"quotedMessageSnapshot":{"description":"Output only. A snapshot of the quoted message's content.","readOnly":true,"$ref":"#/components/schemas/ChatQuotedMessageSnapshot"},"name":{"description":"Required. Resource name of the message that is quoted. Format: `spaces/{space}/messages/{message}`","type":"string"}},"type":"object","description":"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)."},"ChatQuotedMessageSnapshot":{"description":"Provides a snapshot of the content of the quoted message at the time of quoting or forwarding","type":"object","properties":{"sender":{"description":"Output only. The quoted message's author name. Populated for both REPLY & FORWARD quote types.","type":"string","readOnly":true},"annotations":{"readOnly":true,"description":"Output only. Annotations parsed from the text body of the quoted message. Populated only for FORWARD quote type.","type":"array","items":{"$ref":"#/components/schemas/ChatAnnotation"}},"text":{"readOnly":true,"description":"Output only. Snapshot of the quoted message's text content.","type":"string"},"formattedText":{"type":"string","description":"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.","readOnly":true},"attachments":{"items":{"$ref":"#/components/schemas/ChatAttachment"},"description":"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.","type":"array","readOnly":true}}},"ChatRichLinkMetadata":{"type":"object","description":"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.","properties":{"uri":{"type":"string","description":"The URI of this link."},"richLinkType":{"type":"string","description":"The rich link type.","enum":["RICH_LINK_TYPE_UNSPECIFIED","DRIVE_FILE","CHAT_SPACE","GMAIL_MESSAGE","MEET_SPACE","CALENDAR_EVENT"]},"calendarEventLinkData":{"$ref":"#/components/schemas/ChatCalendarEventLinkData","description":"Data for a Calendar event link."},"driveLinkData":{"$ref":"#/components/schemas/ChatDriveLinkData","description":"Data for a drive link."},"chatSpaceLinkData":{"description":"Data for a chat space link.","$ref":"#/components/schemas/ChatChatSpaceLinkData"},"meetSpaceLinkData":{"$ref":"#/components/schemas/ChatMeetSpaceLinkData","description":"Data for a Meet space link."}}},"ChatSearchMessageResult":{"type":"object","properties":{"spaceMuteSetting":{"enum":["MUTE_SETTING_UNSPECIFIED","UNMUTED","MUTED"],"description":"The mute setting of the calling user for the space where the message is posted. The caller app can use this information to decide how to process the message depending on whether the space is muted for the user or not. Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the calling credentials include the following [authorization scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.spacesettings`","type":"string"},"message":{"$ref":"#/components/schemas/ChatMessage","description":"The matched message."},"read":{"description":"Indicates if the matched message is read by the calling user. Only returned if the request view is `SEARCH_MESSAGES_VIEW_FULL` and the calling credentials include one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - `https://www.googleapis.com/auth/chat.users.readstate`","type":"boolean"}},"description":"A single result item from a message search."},"ChatSearchMessagesRequest":{"description":"Request message for searching messages.","type":"object","properties":{"pageToken":{"description":"Optional. A token, received from the previous search 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.","type":"string"},"pageSize":{"type":"integer","format":"int32","description":"Optional. The maximum number of results to return. The service may return fewer than this value. If unspecified, at most 25 are returned. The maximum value is 100. If you use a value more than 100, it's automatically changed to 100."},"filter":{"description":"Required. A search query. The query can specify one or more search keywords, which are used to filter the results, You can also filter the results using the following message fields: - `create_time`: Accepts a timestamp in [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339) format and the supported comparison operators are: `<` and `>=`. - `sender.name`: The resource name of the sender (`users/{user}`). Only supports `=`. You can use the e-mail as an alias for `{user}`. For example, `users/example@gmail.com`, where `example@gmail.com` is the e-mail of the Google Chat user. - `space.name`: The resource name of the space where the message is posted. (`spaces/{space}`). Only supports `=`. If this filter is not set, the search is performed across all direct messages and spaces the user has access to as a space member. - `space.display_name`: Supports the operator `:` (has) and filters spaces based on a partial match of their display name. Results are limited to the top five space matches. For example, `space.display_name:Project` searches for messages in the top five spaces that contain the word \"Project\" in their display names. - `space.space_type`: The type of the space. Only supports `=`. For example, `space.space_type=\"DIRECT_MESSAGE\"` returns only messages from direct messages. The possible values are `DIRECT_MESSAGE`, `GROUP_CHAT`, and `SPACE`. - `attachment`: Supports the operator `:*` (has any) to check for the presence of attachments. If `attachment:*` is specified, only messages that have at least one attachment are returned. - `annotations.user_mentions.user.name`: The resource name of the mentioned user (`users/{user}`). Only supports `:` (has). For example: `annotations.user_mentions.user.name:\"users/1234567890\"` returns only messages that contain a mention to the specified user. Alternatively, the alias `me` can be used to filter for messages that mention the caller user, for example: `annotations.user_mentions.user.name:users/me`. You can also use the e-mail as an alias for `{user}`, for example, `users/example@gmail.com`. For advanced filtering, the following functions are also available: - `has_link()`: Returns only messages that have at least one hyperlink in the message text. - `is_unread()`: Filters out messages that have been read by the calling user. Using the `space.display_name` or the `space.space_type` filters requires that the calling credentials include one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.spaces.readonly` - `https://www.googleapis.com/auth/chat.spaces` Using the `is_unread()` filter requires that the calling credentials include one of the following [authorization scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes): - `https://www.googleapis.com/auth/chat.users.readstate.readonly` - `https://www.googleapis.com/auth/chat.users.readstate` Across different fields, only `AND` operators are supported. A valid example is `sender.name = \"users/1234567890\" AND is_unread()`. The word `AND` is optional and is implied if omitted. For example, `sender.name = \"users/1234567890\" is_unread()` is valid and is equivalent to the previous example. An invalid example is `sender.name = \"users/1234567890\" OR is_unread()` because `OR` is not supported between different fields. Among the same field: - `create_time` supports only `AND`, and can only be used to represent an interval, such as `create_time >= \"2022-01-01T00:00:00+00:00\" AND create_time < \"2023-01-01T00:00:00+00:00\"`. - `sender.name` supports only the `OR` operator, for example: `sender.name = \"users/1234567890\" OR sender.name = \"users/0987654321\"`. - `space.name` supports only the `OR` operator, for example: `space.name = \"spaces/ABCDEFGH\" OR space.name = \"spaces/QWERTYUI\"`. - `space.display_name` supports the operators `AND` and `OR`, but not a mix of both. For example: `space.display_name:Project AND space.display_name:Tasks` returns messages that are in spaces with display names containing both `Project` and `Tasks`, whereas `space.display_name:Project OR space.display_name:Tasks` returns messages that are in spaces with display names containing either `Project` or `Tasks` or both. - `space.space_type` supports only the `OR` operator, for example: `space.space_type = \"DIRECT_MESSAGE\" OR space.space_type = \"GROUP_CHAT\"`. - `annotations.user_mentions.user.name` supports the operators `AND` and `OR`, but not a mix of both. For example: `annotations.user_mentions.user.name:\"users/1234567890\" AND annotations.user_mentions.user.name:\"users/0987654321\"` returns only messages that mentions both users, whereas `annotations.user_mentions.user.name:\"users/1234567890\" OR annotations.user_mentions.user.name:\"users/0987654321\"` returns messages that mention either user or both. Parentheses are required to disambiguate operator precedence when combining `AND` and `OR` operators in the same query. For example: `(sender.name=\"users/me\" OR sender.name=\"users/123456\") AND is_unread()`. Otherwise, parentheses are optional. The following example queries are valid: ``` \"Pending reports\" AND create_time >= \"2023-01-01T00:00:00Z\" sender.name = \"users/example@gmail.com\" annotations.user_mentions.user.name:\"users/0987654321\" attachment:* AND space.name = \"spaces/ABCDEFGH\" tasks AND is_unread() AND sender.name = \"users/1234567890\" \"things to do\" \"urgent\" (sender.name = \"users/1234567890\") AND (create_time < \"2023-05-01T00:00:00Z\") tasks AND space.name = \"spaces/ABCDEFGH\" AND has_link() \"project one\" is_unread() space.display_name:Project tasks ``` The maximum query length is 1,000 characters. Invalid queries are rejected by the server with an `INVALID_ARGUMENT` error.","type":"string"},"markupSyntax":{"description":"Optional. Specifies the desired output syntax for the Chat message `formatted_text` field.","type":"string","enum":["MARKUP_SYNTAX_UNSPECIFIED","MARKUP_SYNTAX_CHAT","MARKUP_SYNTAX_MARKDOWN"]},"orderBy":{"description":"Optional. How the results list is ordered. Supported attributes to order by are: - `create_time`: Sorts the results by the time of the message creation. Default value. - `relevance`: Sorts the results by relevance. [Developer Preview](https://developers.google.com/workspace/preview). The default ordering is `create_time desc`. Only a single order per query (`create_time` or `relevance`) is supported. Only descending order (`desc`) is supported, and it must be specified after the order attribute.","type":"string"},"view":{"description":"Optional. Specifies what kind of search results view to return. The default is `SEARCH_MESSAGES_VIEW_BASIC`.","type":"string","enum":["SEARCH_MESSAGES_VIEW_UNSPECIFIED","SEARCH_MESSAGES_VIEW_BASIC","SEARCH_MESSAGES_VIEW_FULL"]}}},"ChatSearchMessagesResponse":{"description":"Response message for searching messages.","properties":{"results":{"type":"array","description":"The list of search results that matched the query.","items":{"$ref":"#/components/schemas/ChatSearchMessageResult"}},"nextPageToken":{"description":"A token that can be used to retrieve the next page. If this field is empty, there are no subsequent pages.","type":"string"}},"type":"object"},"ChatSetUpSpaceRequest":{"properties":{"requestId":{"type":"string","description":"Optional. A unique ID for this request. A random UUID is recommended. Specifying a request ID makes the request idempotent, which ensures that multiple identical requests with the same request ID result in only a single space being created. Subsequent requests with the same request ID return the existing space and do not update the space, even if the requested details differ from the current state. To use this field effectively: - Ensure that subsequent requests are identical and use the same authentication credentials as the original request. - If a space was already created with the provided request ID, the request returns that space. Note that the returned space might not be fully populated; the API echoes the space in your request with the system-assigned resource name populated. To retrieve the latest metadata for the space, call `GetSpace`. - Reusing an existing request ID with a different authenticated user results in an error."},"space":{"$ref":"#/components/schemas/ChatSpace","description":"Required. The `Space.spaceType` field is required. To create a space, set `Space.spaceType` to `SPACE` and set `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when setting up a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name. To create a group chat, set `Space.spaceType` to `GROUP_CHAT`. Don't set `Space.displayName`. To create a 1:1 conversation between humans, set `Space.spaceType` to `DIRECT_MESSAGE` and set `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or `Space.spaceDetails`. To create an 1:1 conversation between a human and the calling Chat app, set `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or `Space.spaceDetails`. If a `DIRECT_MESSAGE` space already exists, that space is returned instead of creating a new space."},"memberships":{"type":"array","items":{"$ref":"#/components/schemas/ChatMembership"},"description":"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 49 memberships (in addition to the caller). For human membership, the `Membership.member` field must contain a `user` with `name` populated (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only add human users when setting up a space (adding Chat apps is only supported for direct message setup with the calling app). You can also add members using the user's email as an alias for {user}. For example, the `user.name` can be `users/example@gmail.com`. To invite Gmail users or users from external Google Workspace domains, user's email must be used for `{user}`. For Google group membership, the `Membership.group_member` field must contain a `group` with `name` populated (format `groups/{group}`). You can only add Google groups when setting `Space.spaceType` to `SPACE`. Optional when setting `Space.spaceType` to `SPACE`. Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at least two memberships. Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human user, along with exactly one membership. Must be empty when creating a 1:1 conversation between a human and the calling Chat app (when setting `Space.spaceType` to `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`)."}},"description":"Request to create a space and add specified users to it.","type":"object"},"ChatSlashCommand":{"properties":{"commandId":{"type":"string","format":"int64","description":"The ID of the slash command."}},"type":"object","description":"Metadata about a [slash command](https://developers.google.com/workspace/chat/commands) in Google Chat."},"ChatSlashCommandMetadata":{"properties":{"triggersDialog":{"description":"Indicates whether the slash command is for a dialog.","type":"boolean"},"type":{"type":"string","description":"The type of slash command.","enum":["TYPE_UNSPECIFIED","ADD","INVOKE"]},"commandName":{"description":"The name of the invoked slash command.","type":"string"},"bot":{"description":"The Chat app whose command was invoked.","$ref":"#/components/schemas/ChatUser"},"commandId":{"description":"The command ID of the invoked slash command.","type":"string","format":"int64"}},"description":"Annotation metadata for slash commands (/).","type":"object"},"ChatSnippet":{"description":"A snippet object representing an excerpt from a larger corpus.","type":"object","properties":{"text":{"description":"Optional. A short plaintext excerpt directly from the corpus that is rendered in the citation hover card or source preview. When footer sources are automatically populated from inline `citations` (because `Elements.cited_sources` is not set), snippets are omitted from the deduplicated footer sources. Does not support markdown format, and must not exceed 1,000 characters.","type":"string"},"imagePreview":{"description":"Optional. Image preview of the snippet provided as an input when creating the citation.","$ref":"#/components/schemas/ChatElementsImage"}}},"ChatSpace":{"type":"object","description":"A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app.","properties":{"lastActiveTime":{"description":"Output only. Timestamp of the last message in the space.","format":"google-datetime","type":"string","readOnly":true},"spaceType":{"enum":["SPACE_TYPE_UNSPECIFIED","SPACE","GROUP_CHAT","DIRECT_MESSAGE"],"type":"string","description":"Optional. The type of space. Required when creating a space or updating the space type of a space. Output only for other usage."},"threaded":{"type":"boolean","deprecated":true,"readOnly":true,"description":"Output only. Deprecated: Use `spaceThreadingState` instead. Whether messages are threaded in this space."},"customer":{"type":"string","description":"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."},"permissionSettings":{"description":"Optional. Space permission settings for existing spaces. Input for updating exact space permission settings, where existing permission settings are replaced. Output lists current permission settings. Reading and updating 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` scope. Only populated and settable when the Chat app created the space. - [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)","$ref":"#/components/schemas/ChatPermissionSettings"},"importMode":{"description":"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).","type":"boolean"},"type":{"type":"string","enum":["TYPE_UNSPECIFIED","ROOM","DM"],"readOnly":true,"description":"Output only. Deprecated: Use `space_type` instead. The type of a space.","deprecated":true},"externalUserAllowed":{"type":"boolean","description":"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."},"adminInstalled":{"description":"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.","type":"boolean","readOnly":true},"membershipCount":{"description":"Output only. The count of joined memberships grouped by member type. Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or `GROUP_CHAT`.","$ref":"#/components/schemas/ChatMembershipCount","readOnly":true},"createTime":{"format":"google-datetime","type":"string","description":"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`."},"spaceHistoryState":{"description":"Optional. The message history state for messages and threads in this space.","type":"string","enum":["HISTORY_STATE_UNSPECIFIED","HISTORY_OFF","HISTORY_ON"]},"displayName":{"description":"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.","type":"string"},"importModeExpireTime":{"description":"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.","type":"string","format":"google-datetime","readOnly":true},"name":{"description":"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`.","type":"string"},"spaceUri":{"readOnly":true,"type":"string","description":"Output only. The URI for a user to access the space."},"accessSettings":{"description":"Optional. Specifies the [access setting](https://support.google.com/chat/answer/11971020) of the space. Only populated when the `space_type` is `SPACE`.","$ref":"#/components/schemas/ChatAccessSettings"},"singleUserBotDm":{"description":"Optional. Whether the space is a DM between a Chat app and a single human.","type":"boolean"},"spaceDetails":{"description":"Optional. Details about the space including description and rules.","$ref":"#/components/schemas/ChatSpaceDetails"},"spaceThreadingState":{"description":"Output only. The threading state in the Chat space.","enum":["SPACE_THREADING_STATE_UNSPECIFIED","THREADED_MESSAGES","GROUPED_MESSAGES","UNTHREADED_MESSAGES"],"type":"string","readOnly":true},"predefinedPermissionSettings":{"enum":["PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED","COLLABORATION_SPACE","ANNOUNCEMENT_SPACE"],"description":"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)","type":"string"}}},"ChatSpaceDetails":{"description":"Details about the space including description and rules.","properties":{"description":{"type":"string","description":"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":{"description":"Optional. The space's rules, expectations, and etiquette. Supports up to 5,000 characters.","type":"string"}},"type":"object"},"ChatSpaceReadState":{"properties":{"name":{"description":"Resource name of the space read state. Format: `users/{user}/spaces/{space}/spaceReadState`","type":"string"},"lastReadTime":{"format":"google-datetime","type":"string","description":"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."}},"description":"A user's read state within a space, used to identify read and unread messages.","type":"object"},"ChatThread":{"type":"object","properties":{"threadKey":{"description":"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.","type":"string"},"name":{"type":"string","description":"Identifier. Resource name of the thread. Example: `spaces/{space}/threads/{thread}`"}},"description":"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."},"ChatUser":{"type":"object","properties":{"avatarUrl":{"description":"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.","type":"string","readOnly":true},"name":{"description":"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":"string"},"type":{"description":"User type.","type":"string","enum":["TYPE_UNSPECIFIED","HUMAN","BOT"]},"domainId":{"type":"string","description":"Unique identifier of the user's Google Workspace domain."},"email":{"type":"string","description":"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.","readOnly":true},"displayName":{"readOnly":true,"type":"string","description":"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."},"isAnonymous":{"readOnly":true,"description":"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.","type":"boolean"}},"description":"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."},"ChatUserMentionMetadata":{"properties":{"user":{"description":"The user mentioned.","$ref":"#/components/schemas/ChatUser"},"type":{"enum":["TYPE_UNSPECIFIED","ADD","MENTION"],"description":"The type of user mention.","type":"string"}},"description":"Annotation metadata for user mentions (@).","type":"object"}},"securitySchemes":{"upstreamOAuth":{"type":"oauth2","description":"Upstream Google OAuth scope used by the proxy (agents use AAuth, not this scheme).","flows":{"authorizationCode":{"authorizationUrl":"https://accounts.google.com/o/oauth2/v2/auth","tokenUrl":"https://oauth2.googleapis.com/token","scopes":{"https://www.googleapis.com/auth/chat.messages":"chat.messages","https://www.googleapis.com/auth/chat.messages.readonly":"chat.messages.readonly","https://www.googleapis.com/auth/chat.spaces.create":"chat.spaces.create","https://www.googleapis.com/auth/chat.spaces.readonly":"chat.spaces.readonly","https://www.googleapis.com/auth/chat.users.readstate.readonly":"chat.users.readstate.readonly","https://www.googleapis.com/auth/gmail.compose":"gmail.compose","https://www.googleapis.com/auth/gmail.labels":"gmail.labels","https://www.googleapis.com/auth/gmail.modify":"gmail.modify","https://www.googleapis.com/auth/gmail.readonly":"gmail.readonly","https://www.googleapis.com/auth/gmail.send":"gmail.send","https://www.googleapis.com/auth/gmail.settings.basic":"gmail.settings.basic"}}}}}}}