Skip to main content

Vault | Python SDK | Secrets Endpoints

Secrets Endpoints

Rotate secret

Vault.rotate_secret(item_id, secret, rotation_state)

Rotate a secret.

required parameters

str

The item ID.

str

The secret value.

optional parameters

RequestManualRotationState

State to which the previous version should transition upon rotation.

response = vault.rotate_secret(item_id="foo", secret="bar")

Store secret

Vault.store_secret(secret, name, folder, metadata, tags, disabled_at)

Store a secret.

required parameters

str

The secret value.

optional parameters

str | None

The name of this item.

str | None

The folder where this item is stored.

Metadata | None

User-provided metadata.

Tags | None

A list of user-defined tags.

datetime.datetime | None

Timestamp indicating when the item will be disabled.

response = vault.store_secret(secret="foobar")