Method: files.delete
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह विकल्प, उपयोगकर्ता के मालिकाना हक वाली किसी फ़ाइल को ट्रैश में भेजे बिना हमेशा के लिए मिटा देता है. ज़्यादा जानकारी के लिए, फ़ाइलों और फ़ोल्डर को ट्रैश में डालना या मिटाना लेख पढ़ें.
अगर फ़ाइल किसी शेयर की गई ड्राइव में मौजूद है, तो उपयोगकर्ता के पास पैरंट फ़ोल्डर के लिए organizer
की भूमिका होनी चाहिए. अगर टारगेट कोई फ़ोल्डर है, तो उपयोगकर्ता के मालिकाना हक वाले सभी डिसेंडेंट भी मिटा दिए जाते हैं.
एचटीटीपी अनुरोध
DELETE https://www.googleapis.com/drive/v3/files/{fileId}
यह यूआरएल, gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल करता है.
पाथ पैरामीटर
पैरामीटर |
fileId |
string
फ़ाइल का आईडी.
|
क्वेरी पैरामीटर
पैरामीटर |
supportsAllDrives |
boolean
अनुरोध करने वाला ऐप्लिकेशन, 'मेरी ड्राइव' और शेयर की गई ड्राइव, दोनों के साथ काम करता है या नहीं.
|
supportsTeamDrives (deprecated) |
boolean
इस्तेमाल बंद कर दिया गया है: इसके बजाय, supportsAllDrives का इस्तेमाल करें.
|
enforceSingleParent (deprecated) |
boolean
बंद कर दी गई सुविधा: अगर कोई आइटम, शेयर की गई ड्राइव में नहीं है और उसके आखिरी पैरंट को मिटा दिया गया है, लेकिन आइटम को नहीं मिटाया गया है, तो आइटम को उसके मालिक के रूट फ़ोल्डर में रख दिया जाएगा.
|
अनुरोध का मुख्य भाग
अनुरोध का मुख्य हिस्सा खाली होना चाहिए.
जवाब का मुख्य भाग
अगर अनुरोध पूरा हो जाता है, तो जवाब के मुख्य हिस्से में एक खाली JSON ऑब्जेक्ट होता है.
अनुमति के स्कोप
इसके लिए, इनमें से किसी एक OAuth स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
कुछ स्कोप पर पाबंदी है. इसलिए, आपके ऐप्लिकेशन को इनका इस्तेमाल करने से पहले सुरक्षा का आकलन करना होगा. ज़्यादा जानकारी के लिए, अनुमति देने से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया."],[],[],null,["# Method: files.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\nPermanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive, the user must be an `organizer` on the parent folder. If the target is a folder, all descendants owned by the user are also deleted.\n\n### HTTP request\n\n`DELETE https://www.googleapis.com/drive/v3/files/{fileId}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|------------------------------|\n| `fileId` | `string` The ID of the file. |\n\n### Query parameters\n\n| Parameters ||\n|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `supportsAllDrives` | `boolean` Whether the requesting application supports both My Drives and shared drives. |\n| `supportsTeamDrives` **(deprecated)** | `boolean` Deprecated: Use `supportsAllDrives` instead. |\n| `enforceSingleParent` **(deprecated)** | `boolean` Deprecated: If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root. |\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/drive`\n- `\n https://www.googleapis.com/auth/drive.appdata`\n- `\n https://www.googleapis.com/auth/drive.file`\n\nSome scopes are restricted and require a security assessment for your app to use them. For more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]