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 |
secret | string | yes | The secret value to store in TF Secrets Manager |
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Operation success status |
data | object | Response data |
message | string | Optional 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');