Create a Secret

In this example we will save a phrase "This is a really big secret!" as the name demosecret.

The name can only contain lowercase alphanumeric characters and ., _ or - characters. The phrase can be anything.

curl -X "POST" \
"https://<url.kelvin.ai>/api/v4/secrets/create" \
-H "Authorization: Bearer <Your Current Token>" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
        "name": "demosecret",
        "value": "This is a really big secret!"
    }'

The response will look like this;

{
    "name": "demosecret"
}
from kelvin.api.client import Client

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

# Create Secret
response = client.secret.create_secret(name="demosecret", value="This is a really big secret!")

print(response)

You will see the output like this;

name='demosecret'
kelvin secret create demosecret --value="This is a really big secret!"

If everything went well you will get the confirmation response like this;

[kelvin.sdk][2024-03-19 20:00:45][I] Creating secret "demosecret" on the platform