Skip to main content

Secrets

Secrets

toothfairyai@latest…

Manager for secrets operations.

This manager provides methods to create, update, and manage secrets.

Example:

>>> client = ToothFairyClient(api_key="...", workspace_id="...")
>>> secret = client.secrets.create(...)

Accessed via client.secrets.

Methods

MethodHTTPEndpoint
createPOSTPOST /secret/create
deleteDELETEDELETE /secret/delete/{secret_id}

create

Create a new secret linked to an authorisation.

def create(
authorisation_id: str,
password_secret_value: str,
suffix: Optional[str] = None
) -> Secret

Endpoint: POST /secret/create · API service

Request fields

Python kwargWire fieldTypeRequiredDescription
ididstringyesAuthorisation record ID to associate the secret with
workspace_idworkspaceidstringyesUnique workspace identifier in UUID v4 format
secretsecretstringyesThe secret value to store in TF Secrets Manager

Always pass snake_case keyword arguments — the Python kwarg column shows the exact name to use for each wire field (as a named parameter where it appears in the method signature, otherwise via **kwargs). The SDK converts it deterministically to the camelCase wire key the API expects. Passing camelCase directly is deprecated: it emits a warning and converts to the same wire key.

Response fields

FieldTypeDescription
successbooleanOperation success status
dataobjectResponse data
messagestringOptional success message

Example

client.secrets.create(authorisation_id="agent-id", password_secret_value="…")

delete

Delete a secret.

def delete(secret_id: str) -> Dict[str, bool]

Endpoint: DELETE /secret/delete/{secret_id} · API service

Response

Returns the SuccessResponse object — fields documented in the create section above.

Example

client.secrets.delete(secret_id="agent-id")