Delete a Secret

In this example we will delete the secret name demosecret.

You can not edit a secret. If you need to update a secret, just delete and create it again with the new value.

API cURL Example
1
2
3
4
5
curl -X "POST" \
"https://<url.kelvin.ai>/api/v4/secrets/demosecret/delete" \
-H "Authorization: Bearer <Your Current Token>" \
-H "Accept: application/json" \
-d ''

The response code will be 200 or an error code from 4XX.

API Client (Python) Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from kelvin.api.client import Client

# Login
client = Client(config={"url": "https://<url.kelvin.ai>", "username": "<your_username>"})
client.login(password="<your_password>")

# Delete Secret
response = client.secret.delete_secret(secret_name="demosecret")

print(response)

You will see the output like this;

API Client (Python) Example Response
1
None
Kelvin SDK Command Line Example
1
kelvin secret delete demosecret

You will need to confirm the delete process and if everything went well you will get the confirmation response like this;

Kelvin SDK Command Line Output
1
2
3
4
5
6
[kelvin.sdk][2024-03-19 21:08:12][I] Deleting secret(s) "demosecret" from the platform
[kelvin.sdk][2024-03-19 21:08:12][W] 
This operation will delete the secret(s) "demosecret" from the platform
        Are you sure?  [y/N] y

[kelvin.sdk][2024-03-19 21:08:17][R] Secret "demosecret" successfully deleted from the platform