Method: spaces.messages.delete
Deletes a message. For an example, see Delete a message.
Supports the following types of authentication:
When using app authentication, requests can only delete messages created by the calling Chat app.
HTTP request
DELETE https://chat.googleapis.com/v1/{name=spaces/*/messages/*}
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters |
name |
string
Required. Resource name of the message. Format: spaces/{space}/messages/{message} If you've set a custom ID for your message, you can use the value from the clientAssignedMessageId field for {message} . For details, see Name a message.
|
Request body
The request body must be empty.
Response body
If successful, the response body is an empty JSON object.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/chat.bot
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.messages
For more information, see the Authorization guide.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-22 UTC.
[null,null,["Last updated 2025-01-22 UTC."],[[["This method enables you to delete messages and optionally their replies using an HTTP DELETE request."],["It supports both app and user authentication, with app authentication limiting deletion to messages created by the app."],["You can specify whether to force delete threaded replies with the `force` query parameter when using user authentication."],["The request requires specifying the message's resource name in the URL path and an empty request body."],["Authorization is required using one of the specified OAuth scopes."]]],["This document details how to delete a message using the Chat API. The `DELETE` request targets a specific message's resource name in the format `spaces/*/messages/*`. It supports both app and user authentication, with different limitations for each. The request requires a message's name as a path parameter. A `force` query parameter is optional for user authentication to delete threaded replies. The request body is empty, and a successful response returns an empty JSON object. One of three specified OAuth scopes is required.\n"]]