Secrets
Secrets
@toothfairyai/sdk@latest…Secret Management Module Handles secret CRUD operations for storing sensitive credentials.
Accessed via client.secrets.
Methods
| Method | HTTP | Endpoint |
|---|---|---|
create | POST | POST /secret/create |
delete | DELETE | DELETE /secret/delete/{id} |
list | GET | GET /secret/list |
get | GET | GET /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
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Authorisation record ID to associate the secret with |
workspaceid | string | yes | Unique workspace identifier in UUID v4 format |
passwordSecretValue | string | no | The secret value to store in Secrets Manager |
secret | string | no | Deprecated legacy alias for passwordSecretValue |
suffix | string | no | Optional suffix appended to the secret name path, e.g. "token" for an OAuth refresh token |
Response fields
| Field | Type | Description |
|---|---|---|
status | string | Operation status ("Success") |
name | string | Full 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');