> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # RemoveFromTrashBin # Package: blog # Namespace: DraftPostService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/blog/draft-posts/remove-from-trash-bin.md ## Permission Scopes: Manage Blog: SCOPE.DC-BLOG.MANAGE-BLOG ## Introduction Permanently deletes a draft post that is currently in the trash bin. This action is permanent and can't be reversed. --- ## REST API ### Schema ``` Method: removeFromTrashBin Description: Permanently deletes a draft post that is currently in the trash bin. This action is permanent and can't be reversed. URL: https://www.wixapis.com/blog/v3/draft-posts/trash-bin/{draftPostId} Method: DELETE # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: draftPostId Method parameters: param name: draftPostId | type: none | required: true Return type: RemoveFromTrashBinResponse EMPTY-OBJECT {} ``` ### Examples ### RemoveFromTrashBin ```curl ~~~cURL curl -X DELETE \ 'https://www.wixapis.com/blog/v3/draft-posts/trash-bin/996cb649-d428-405d-b9ed-4facd46e2443' \ -H 'Content-Type: application/json' \ -H 'Authorization: ' \ ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.blog.DraftPostService.removeFromTrashBin(draftPostId) Description: Permanently deletes a draft post that is currently in the trash bin. This action is permanent and can't be reversed. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: draftPostId Method parameters: param name: draftPostId | type: string | description: Draft post GUID. | required: true Return type: PROMISE EMPTY-OBJECT {} ``` ### Examples ### Permanently delete a draft post (with elevated permissions) ```javascript import { draftPosts } from '@wix/blog'; import { auth } from '@wix/essentials'; const elevatedRemoveFromTrashBin = auth.elevate(draftPosts.removeFromTrashBin); // Sample draftPostId value: "dd0907fa-ca4b-4fe4-ab9e-625e4733691e" export async function myRemoveFromTrashBinFunction(draftPostId) { try { await elevatedRemoveFromTrashBin(draftPostId); console.log('Permanently deleted the following draft post:', draftPostId); return; } catch (error) { console.error(error); // Handle the error } } // Promise returns void ``` ### Permanently delete a draft post ```javascript import { draftPosts } from '@wix/blog'; // Sample draftPostId value: "dd0907fa-ca4b-4fe4-ab9e-625e4733691e" export async function myRemoveFromTrashBinFunction(draftPostId) { try { await draftPosts.removeFromTrashBin(draftPostId); console.log('Permanently deleted the following draft post:', draftPostId); return; } catch (error) { console.error(error); // Handle the error } } // Promise returns void ``` ### removeFromTrashBin (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { draftPosts } from '@wix/blog'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { draftPosts }, // Include the auth strategy and host as relevant }); async function removeFromTrashBin(draftPostId) { const response = await myWixClient.draftPosts.removeFromTrashBin(draftPostId); }; ``` ---