Complete API reference for the Kubiya Secrets service methods and classes
list() -> Union[List[Dict[str, Any]], str]
Union[List[Dict[str, Any]], str]
: List of secret metadata dictionaries or formatted stringget(name: str) -> Union[Dict[str, Any], str]
name
(str
): The name of the secret to retrieveUnion[Dict[str, Any], str]
: Secret metadata dictionary or formatted stringvalue(name: str) -> Union[str, Dict[str, str]]
name
(str
): The name of the secret whose value to retrieveUnion[str, Dict[str, str]]
: The secret value as a string, or dictionary with value keySecretValidationError
: If the secret name is empty or invalidSecretError
: If the secret doesn’t exist or cannot be retrievedcreate(name: str, value: Optional[str] = None, description: Optional[str] = None, from_file: Optional[str] = None) -> Dict[str, Any]
name
(str
): The name for the new secretvalue
(Optional[str]
): The secret value (mutually exclusive with from_file
)description
(Optional[str]
): Optional description for the secretfrom_file
(Optional[str]
): Path to file containing the secret value (mutually exclusive with value
)Dict[str, Any]
: Creation response with success confirmationSecretValidationError
: If validation fails (empty name, both value and from_file provided, or neither provided)SecretError
: If file doesn’t exist (when using from_file) or creation failsvalue
or from_file
must be provided, but not bothfrom_file
is used, the file must exist and be readableupdate(name: str, value: Optional[str] = None, description: Optional[str] = None, from_file: Optional[str] = None) -> Dict[str, Any]
name
(str
): The name of the secret to updatevalue
(Optional[str]
): The new secret value (mutually exclusive with from_file
)description
(Optional[str]
): The new description for the secretfrom_file
(Optional[str]
): Path to file containing the new secret value (mutually exclusive with value
)Dict[str, Any]
: Update response with success confirmationSecretValidationError
: If validation fails (both value and from_file provided, or neither provided)SecretError
: If file doesn’t exist (when using from_file), secret doesn’t exist, or update failsvalue
or from_file
must be provided, but not bothfrom_file
is used, the file must exist and be readabledelete(name: str) -> Dict[str, Any]
name
(str
): The name of the secret to deleteDict[str, Any]
: Deletion response with success confirmationSecretError
: If the secret doesn’t exist or deletion failssecret_name
(Optional[str]
): Name of the secret that caused the error (if applicable)details
(Optional[Dict[str, Any]]
): Additional error context including secret_name