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

Response fields​

FieldTypeDescription
statusstringOperation status ("Success")
namestringFull Secrets Manager secret name, i.e. ${workspaceid}/${id} or ${workspaceid}/${id}/${suffix}

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 SecretWriteResponse 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');