---
name: secrets-manager-secret-delete
title: Deleting secrets
description: You can use IBM Cloud&reg; Secrets Manager to delete a secret and its contents.
last-updated: 2025-09-17
---

> ## Documentation Index
> The table of contents for this documentation set is at https://cloud.ibm.com/docs/secrets-manager?format=markdown
> The index for all IBM Cloud docs is at: https://cloud.ibm.com/docs/llms.txt
> Use these files to discover more information as needed.

{:codeblock: .codeblock}
{:screen: .screen}
{:download: .download}
{:external: target="_blank" .external}
{:faq: data-hd-content-type='faq'}
{:gif: data-image-type='gif'}
{:important: .important}
{:note: .note}
{:pre: .pre}
{:tip: .tip}
{:preview: .preview}
{:deprecated: .deprecated}
{:beta: .beta}
{:term: .term}
{:shortdesc: .shortdesc}
{:script: data-hd-video='script'}
{:support: data-reuse='support'}
{:table: .aria-labeledby="caption"}
{:troubleshoot: data-hd-content-type='troubleshoot'}
{:help: data-hd-content-type='help'}
{:tsCauses: .tsCauses}
{:tsResolve: .tsResolve}
{:tsSymptoms: .tsSymptoms}
{:video: .video}
{:step: data-tutorial-type='step'}
{:tutorial: data-hd-content-type='tutorial'}
{:api: .ph data-hd-interface='api'}
{:cli: .ph data-hd-interface='cli'}
{:ui: .ph data-hd-interface='ui'}
{:terraform: .ph data-hd-interface="terraform"}
{:curl: .ph data-hd-programlang='curl'}
{:java: .ph data-hd-programlang='java'}
{:ruby: .ph data-hd-programlang='ruby'}
{:c#: .ph data-hd-programlang='c#'}
{:objectc: .ph data-hd-programlang='Objective C'}
{:python: .ph data-hd-programlang='python'}
{:javascript: .ph data-hd-programlang='javascript'}
{:php: .ph data-hd-programlang='PHP'}
{:swift: .ph data-hd-programlang='swift'}
{:curl: .ph data-hd-programlang='curl'}
{:dotnet-standard: .ph data-hd-programlang='dotnet-standard'}
{:go: .ph data-hd-programlang='go'}
{:unity: .ph data-hd-programlang='unity'}
{:release-note: data-hd-content-type='release-note'}

# Deleting secrets
{: #delete-secrets}

You can use IBM Cloud&reg; Secrets Manager to delete a secret and its contents.
{: shortdesc}

## Before you begin
{: #before-delete-secrets}

Before you begin, be sure that you have the required level of access. To delete secrets, you need the [**Manager** service role](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-iam&format=markdown).

If you have a service ID or API key that was generated by the IAM credentials secret engine and delete your instance of Secrets Manager, you must also delete the secret from IAM.
{: tip}

## Deleting secrets in the UI
{: #delete-secret-ui}
{: ui}

You can use the Secrets Manager UI to manually delete your secrets.

1. In the console, click the **Menu** icon ![Menu icon](../icons/icon_hamburger.svg) **> Resource List**.
2. From the list of services, select your instance of Secrets Manager.
3. Use the **Secrets** table to browse the secrets in your instance.
4. In the row for the secret that you want to delete, click the **Actions** menu ![Actions icon](../icons/actions-icon-vertical.svg) **> Delete**.
5. Enter the name of the secret to confirm its deletion.
6. Click **Delete**.

If attempting to delete a custom credentials secret, note that it cannot be deleted if it has a secret version that still needs to be deleted in the credentials provider.  
You can force delete it by ticking the force delete checkbox.
{: note}

## Deleting secrets from the CLI
{: #delete-secret-cli}
{: cli}

To delete a secret, run the [**`ibmcloud secrets-manager secret-delete`**](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secrets-manager-cli&format=markdown#secrets-manager-cli-secret-delete-command) command.

If attempting to delete a custom credentials secret, note that it cannot be deleted if it has a secret version that still needs to be deleted in the credentials provider.  
You can force delete it using the `--force-delete` option.
{: note}


```sh
ibmcloud secrets-manager secret-delete --id ID
```
{: pre}

For more information about the command options, see [**`ibmcloud secrets-manager secret`**](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secrets-manager-cli&format=markdown#secrets-manager-cli-secret-command).

## Deleting secrets with the API
{: #delete-secret-api}
{: api}

You can delete secrets by calling the Secrets Manager API.

The following example request deletes a secret and its contents. When you call the API, replace the ID variables and IAM token with the values that are specific to your Secrets Manager instance.

If attempting to delete a custom credentials secret, note that it cannot be deleted if it has a secret version that still needs to be deleted in the credentials provider.  
You can force delete it using `force_delete` option.
{: note}

``` sh
curl -X DELETE  
  --H "Authorization: Bearer {iam_token}" \ 
  "https://{instance_ID}.{region}.secrets-manager.appdomain.cloud/api/v2/secrets/{id}"
```
{: codeblock}
{: curl}