Docker - delete secret using REST API

by
Jeremy Canfield |
Updated: February 12 2022
| Docker articles
A secret is a file that contains sensitive data, such as a password.
You will need an auth_token before you can delete a secret using curl. Let's say you want to delete the secret named "my_secret" that has an ID of pp6d206pqk28cj12kjv36l2v7.
The following curl command can be used to delete the secret using "my_secret".
curl -k -X DELETE -H "Authorization: Bearer $auth_token" -H 'Accept: application/json' https://hostname:port/secrets/my_secret
The following curl command can be used to delete the secret using the secret ID.
curl -k -X DELETE -H "Authorization: Bearer $auth_token" -H 'Accept: application/json' https://hostname:port/secrets/pp6d206pqk28cj12kjv36l2v7
Did you find this article helpful?
If so, consider buying me a coffee over at