DocumentationDocumentation
GitHubGitHub (opens in a new tab)
  • Overview
    • Installation
    • Quickstart
    • Sign-in & session
    • Keys & identities
    • How data is encrypted
    • Zero-knowledge
    • Sharing models
  • Client SDK
  • Auth
    • Login with a redirect
    • Session and storage
    • Logout
  • Cloud
    • Upload files and folders
    • Edit files and folders
    • Move files and folders
    • Sharing
    • Share
    • List shared nodes
    • Stop sharing
    • Trash
    • Move to trash
    • Restore from trash
    • Delete permanently
    • Empty the trash
  • Mail
    • Send a mail
    • Send to non-registered users
    • Drafts
    • Save a draft
    • Edit a draft
    • Inbox
    • Mark as read or unread
    • Count unread mails
    • Trash
    • Move to trash
    • List mails in trash
    • Restore from trash
    • Delete permanently
    • Empty the trash
  • Transfer
    • Create a public link
    • Download from a link
    • Revoke a public link
    • Transfers without an account
  • Anonymous encryption
    • Encrypt data anonymously
  • Reference
  • Errors
  • API reference
  • Usage & Pricing

On This Page

  • Delete all mails from the trash
Question? Give us feedback → (opens in a new tab)Edit this page
Documentation
Client SDK
Mail
Empty the trash

Delete all mails from the trash

The secrecyClient.mail.emptyTrash permanently removes all mails from the trash. It does not take any parameters.

mail-trash.ts
const deleteAllMailsFromTrash = async (): Promise<boolean> => {
  // First we need to check if the secrecyClient is available
  if (!secrecyClient) {
    return false;
  }
 
  try {
    const isDeleted = await secrecyClient.mail.emptyTrash();
    return isDeleted;
  } catch (error) {
    console.error(error);
    return false;
  }
};
Delete permanentlyTransfer

© SECRECY 2026