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

FieldTypeRequiredDescription
idstringyesAuthorisation record ID to associate the secret with
workspaceidstringyesUnique workspace identifier in UUID v4 format
secretstringyesThe secret value to store in TF Secrets Manager

The Python SDK accepts snake_case keyword arguments and converts them to the camelCase wire fields shown above.

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")