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
password_secret_valuepasswordSecretValuestringnoThe secret value to store in Secrets Manager
secretsecretstringnoDeprecated legacy alias for passwordSecretValue
suffixsuffixstringnoOptional suffix appended to the secret name path, e.g. "token" for an OAuth refresh token

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
statusstringOperation status ("Success")
namestringFull Secrets Manager secret name, i.e. ${workspaceid}/${id} or ${workspaceid}/${id}/${suffix}

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 SecretWriteResponse object — fields documented in the create section above.

Example​

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