Skip to main content

Secrets

Secrets

@toothfairyai/sdk@latest…

Secret Management Module Handles secret CRUD operations for storing sensitive credentials.

Accessed via client.secrets.

Methods

MethodHTTPEndpoint
createPOSTPOST /secret/create
deleteDELETEDELETE /secret/delete/{id}
listGETGET /secret/list
getGETGET /secret/get/{id}

create

Create a new secret linked to an authorisation

async create(authorisationId: string, passwordSecretValue: string)

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

Response fields

FieldTypeDescription
successbooleanOperation success status
dataobjectResponse data
messagestringOptional success message

Example

const result = await client.secrets.create('agent-id', '…');

delete

Delete a secret

async delete(secretId: string): Promise<

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

Response

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

Example

const result = await client.secrets.delete('agent-id');

list

List all secrets in the workspace

async list(limit?: number, offset?: number)

Endpoint: GET /secret/list

Field-level schema not available in the API spec for this endpoint.

Example

const result = await client.secrets.list();

get

Get a secret by ID

async get(secretId: string)

Endpoint: GET /secret/get/{id}

Field-level schema not available in the API spec for this endpoint.

Example

const result = await client.secrets.get('agent-id');