Method: spaces.delete
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
删除指定聊天室。始终执行级联删除,这意味着聊天室的子资源(例如聊天室中发布的消息和聊天室中的成员资格)也会被删除。有关示例,请参阅删除聊天室。
支持以下类型的身份验证:
应用身份验证(需经管理员批准)和授权范围:
https://www.googleapis.com/auth/chat.app.delete
(仅限应用创建的聊天室)
使用以下授权范围之一进行用户身份验证:
https://www.googleapis.com/auth/chat.delete
https://www.googleapis.com/auth/chat.import
(仅限“导入模式聊天室”)
- 当管理员账号通过身份验证时,用户身份验证会授予管理员权限,
useAdminAccess
为 true
,并使用以下授权范围:
https://www.googleapis.com/auth/chat.admin.delete
HTTP 请求
DELETE https://chat.googleapis.com/v1/{name=spaces/*}
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
必需。要删除的会议室的资源名称。 格式:spaces/{space}
|
查询参数
参数 |
useAdminAccess |
boolean
可选。如果值为 true ,则该方法会使用用户的 Google Workspace 管理员权限运行。 调用用户必须是拥有“管理聊天和聊天室对话”权限的 Google Workspace 管理员。 需要 chat.admin.delete OAuth 2.0 范围。
|
响应正文
如果成功,则响应正文为空的 JSON 对象。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/chat.app.delete
https://www.googleapis.com/auth/chat.admin.delete
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.delete
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-29。
[null,null,["最后更新时间 (UTC):2025-07-29。"],[[["\u003cp\u003eThis request permanently deletes a space and all its child resources, including messages and memberships.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication can be performed using app authentication (with administrator approval) or user authentication (including with administrator privileges using \u003ccode\u003euseAdminAccess\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe request requires the space's resource name in the URL path and can optionally use the \u003ccode\u003euseAdminAccess\u003c/code\u003e query parameter for administrator privileges.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific OAuth scopes for authorization, such as \u003ccode\u003echat.app.delete\u003c/code\u003e or \u003ccode\u003echat.admin.delete\u003c/code\u003e, as detailed in the Authorization guide.\u003c/p\u003e\n"]]],["This describes how to delete a named space using the Chat API, including its child resources. A `DELETE` request is sent to `https://chat.googleapis.com/v1/{name=spaces/*}`. The `name` path parameter specifies the space to delete. The `useAdminAccess` query parameter enables administrator privileges, which requires the `chat.admin.delete` OAuth scope and specific admin rights. The request body must be empty, and a successful deletion returns an empty JSON object. Authorization requires specific OAuth scopes.\n"],null,["# Method: spaces.delete\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nDeletes a named space. Always performs a cascading delete, which means that the space's child resources---like messages posted in the space and memberships in the space---are also deleted. For an example, see [Delete a space](https://developers.google.com/workspace/chat/delete-spaces).\n\nSupports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):\n\n- [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) and the authorization scope:\n\n - `https://www.googleapis.com/auth/chat.app.delete` (only in spaces the app created)\n- [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.delete`\n - `https://www.googleapis.com/auth/chat.import` (import mode spaces only)\n - User authentication grants administrator privileges when an administrator account authenticates, `useAdminAccess` is `true`, and the following authorization scope is used:\n - `https://www.googleapis.com/auth/chat.admin.delete`\n\n### HTTP request\n\n`DELETE https://chat.googleapis.com/v1/{name=spaces/*}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------|\n| `name` | `string` Required. Resource name of the space to delete. Format: `spaces/{space}` |\n\n### Query parameters\n\n| Parameters ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `useAdminAccess` | `boolean` 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.delete` [OAuth 2.0 scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.app.delete`\n- `https://www.googleapis.com/auth/chat.admin.delete`\n- `https://www.googleapis.com/auth/chat.import`\n- `https://www.googleapis.com/auth/chat.delete`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]