Method: spaces.members.delete
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह सदस्यता को मिटाता है. उदाहरण के लिए, किसी स्पेस से किसी उपयोगकर्ता या Google Chat ऐप्लिकेशन को हटाना लेख पढ़ें.
इन तरह के authentication के साथ काम करता है:
एडमिन की मंज़ूरी और अनुमति के दायरे के साथ ऐप्लिकेशन की पुष्टि करना:
https://www.googleapis.com/auth/chat.app.memberships
उपयोगकर्ता की पुष्टि के लिए, अनुमति के इन स्कोप में से किसी एक का इस्तेमाल करें:
https://www.googleapis.com/auth/chat.memberships
https://www.googleapis.com/auth/chat.memberships.app
(स्पेस से कॉलिंग ऐप्लिकेशन हटाने के लिए)
https://www.googleapis.com/auth/chat.import
(सिर्फ़ इंपोर्ट मोड वाले स्पेस)
- उपयोगकर्ता की पुष्टि करने पर, एडमिन के अधिकारों को अनुमति मिलती है. ऐसा तब होता है, जब एडमिन खाता पुष्टि करता है,
useAdminAccess
true
होता है, और अनुमति के इस स्कोप का इस्तेमाल किया जाता है:
https://www.googleapis.com/auth/chat.admin.memberships
ऐप्लिकेशन की मदद से पुष्टि करने की सुविधा, इन इस्तेमाल के उदाहरणों के लिए काम नहीं करती:
- किसी स्पेस से Google ग्रुप को हटाना.
- किसी स्पेस से Chat ऐप्लिकेशन को हटाना.
स्पेस मैनेजर की सदस्यताएं मिटाने का अनुरोध करने वाले व्यक्ति के पास, स्पेस मैनेजर की भूमिका होनी चाहिए. अगर ऐप्लिकेशन की मदद से पुष्टि करने की सुविधा का इस्तेमाल किया जा रहा है, तो Chat ऐप्लिकेशन को स्पेस बनाना होगा.
एचटीटीपी अनुरोध
DELETE https://chat.googleapis.com/v1/{name=spaces/*/members/*}
यह यूआरएल, gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल करता है.
पाथ पैरामीटर
पैरामीटर |
name |
string
ज़रूरी है. पैसे चुकाकर ली गई सदस्यता को मिटाने के लिए, उसके संसाधन का नाम. चैट ऐप्लिकेशन, लोगों की सदस्यताएं या अपनी सदस्यताएं मिटा सकते हैं. चैट ऐप्लिकेशन, दूसरे ऐप्लिकेशन की सदस्यताएं नहीं मिटा सकते. किसी व्यक्ति की सदस्यता मिटाने के लिए, chat.memberships स्कोप के साथ उपयोगकर्ता की पुष्टि या chat.memberships.app स्कोप के साथ ऐप्लिकेशन की पुष्टि और spaces/{space}/members/{member} फ़ॉर्मैट की ज़रूरत होती है. इस ईमेल पते का इस्तेमाल, {member} के लिए उपनाम के तौर पर किया जा सकता है. उदाहरण के लिए, spaces/{space}/members/example@gmail.com , जहां example@gmail.com , Google Chat इस्तेमाल करने वाले व्यक्ति का ईमेल पता है. किसी ऐप्लिकेशन की सदस्यता मिटाने के लिए, chat.memberships.app स्कोप और spaces/{space}/members/app फ़ॉर्मैट की ज़रूरत होती है. फ़ॉर्मैट: spaces/{space}/members/{member} या spaces/{space}/members/app .
|
क्वेरी पैरामीटर
पैरामीटर |
useAdminAccess |
boolean
ज़रूरी नहीं. true होने पर, यह तरीका उपयोगकर्ता के Google Workspace एडमिन के अधिकारों का इस्तेमाल करके काम करता है. कॉल करने वाला व्यक्ति, Google Workspace एडमिन होना चाहिए. साथ ही, उसके पास चैट और स्पेस में होने वाली बातचीत को मैनेज करने का अधिकार होना चाहिए. इसके लिए, chat.admin.memberships OAuth 2.0 स्कोप की ज़रूरत होती है. एडमिन ऐक्सेस का इस्तेमाल करके, किसी स्पेस में ऐप्लिकेशन की सदस्यताएं नहीं मिटाई जा सकतीं.
|
अनुरोध का मुख्य भाग
अनुरोध का मुख्य हिस्सा खाली होना चाहिए.
जवाब का मुख्य हिस्सा
कामयाब रहने पर, जवाब के मुख्य हिस्से में Membership
का एक इंस्टेंस शामिल किया जाता है.
अनुमति के स्कोप
इसके लिए, इनमें से किसी एक OAuth स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/chat.app.memberships
https://www.googleapis.com/auth/chat.admin.memberships
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.memberships
https://www.googleapis.com/auth/chat.memberships.app
ज़्यादा जानकारी के लिए, अनुमति पाने से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को 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\u003eDeletes a specified membership from a Google Chat space, allowing removal of human users or Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific OAuth scopes depending on the type of membership being deleted and whether admin privileges are used.\u003c/p\u003e\n"],["\u003cp\u003eSupports app and user authentication, with an option for administrator approval in Developer Preview for app authentication.\u003c/p\u003e\n"],["\u003cp\u003eUses a \u003ccode\u003eDELETE\u003c/code\u003e request with the membership's resource name specified in the path.\u003c/p\u003e\n"],["\u003cp\u003eProvides an optional \u003ccode\u003euseAdminAccess\u003c/code\u003e query parameter to utilize administrator privileges when deleting human memberships.\u003c/p\u003e\n"]]],["This API action deletes a membership using a `DELETE` request to `https://chat.googleapis.com/v1/{name=spaces/*/members/*}`. It requires specifying the membership's resource name in the `name` path parameter. Deleting human memberships requires the `chat.memberships` scope, while deleting app memberships requires the `chat.memberships.app` scope. Administrators can use `useAdminAccess` query parameter to operate with elevated privileges. The request body should be empty, and a successful response returns a `Membership` instance. Necessary authorization scopes include `chat.app.memberships`, `chat.admin.memberships`, `chat.import`, `chat.memberships`, and `chat.memberships.app`.\n"],null,["# Method: spaces.members.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 membership. For an example, see [Remove a user or a Google Chat app from a space](https://developers.google.com/workspace/chat/delete-members).\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.memberships`\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.memberships`\n - `https://www.googleapis.com/auth/chat.memberships.app` (to remove the calling app from the space)\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.memberships`\n\nApp authentication is not supported for the following use cases:\n\n- Removing a Google Group from a space.\n- Removing a Chat app from a space.\n\nTo delete memberships for space managers, the requester must be a space manager. If you're using [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) the Chat app must be the space creator.\n\n### HTTP request\n\n`DELETE https://chat.googleapis.com/v1/{name=spaces/*/members/*}`\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 membership to delete. Chat apps can delete human users' or their own memberships. Chat apps can't delete other apps' memberships. When deleting a human membership, requires the `chat.memberships` scope with [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) or the `chat.memberships.app` scope with [app authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) and the `spaces/{space}/members/{member}` format. You can use the email as an alias for `{member}`. For example, `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the email of the Google Chat user. When deleting an app membership, requires the `chat.memberships.app` scope and `spaces/{space}/members/app` format. Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`. |\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.memberships` [OAuth 2.0 scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes). Deleting app memberships in a space isn't supported using admin access. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [Membership](/workspace/chat/api/reference/rest/v1/spaces.members#Membership).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.app.memberships`\n- `https://www.googleapis.com/auth/chat.admin.memberships`\n- `https://www.googleapis.com/auth/chat.import`\n- `https://www.googleapis.com/auth/chat.memberships`\n- `https://www.googleapis.com/auth/chat.memberships.app`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]