Skip to main content
client.secrets.update_secret_by_name() changes a secret’s value, name, comment, tags, or other settings. The machine identity needs a role in the project that can change secrets, such as Member.

Parameters

str
required
The current name of the secret.
str
The ID of the project. Pass project_id or project_slug. If you pass both, the SDK uses project_id.
str
The slug of the project.
str
required
The slug of the environment, such as dev.
str
required
The path of the folder, such as / or /backend.
str
The new value of the secret.
str
A new name for the secret.
str
A new comment for the secret.
List[str]
The IDs of the secret’s tags, which replace its current tags.
List[Dict[str, Any]]
Key-value pairs to store with the secret, each a dictionary with key and value.
bool
default:"False"
Whether to store a multi-line value without encoding its line breaks.
str
The note that Infisical sends with each reminder to rotate the secret.
int
The number of days between reminders, at least 1.

Returns

BaseSecret
The updated secret, with its id, secretKey, secretValue, secretValueHidden, secretComment, environment, type, and version. To get its tags and metadata, call get_secret_by_name. Its secretValue and secretComment hold only the values that this call sent.