Method: spaces.delete
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस तरीके का इस्तेमाल करके, नाम वाला स्पेस मिटाया जाता है. यह हमेशा कैस्केडिंग डिलीट करता है. इसका मतलब है कि स्पेस के चाइल्ड रिसॉर्स भी मिट जाते हैं. जैसे, स्पेस में पोस्ट किए गए मैसेज और स्पेस की सदस्यताएं. उदाहरण के लिए, स्पेस मिटाना लेख पढ़ें.
इन तरह के authentication के साथ काम करता है:
एडमिन की मंज़ूरी और अनुमति के दायरे के साथ ऐप्लिकेशन की पुष्टि करना:
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
एचटीटीपी अनुरोध
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
ज़्यादा जानकारी के लिए, अनुमति पाने से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-29 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-29 (UTC) को अपडेट किया गया."],[[["\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)."]]