Connections
Connections
@toothfairyai/sdk@latest…Connection Management Module Handles connection CRUD operations for external integrations.
Accessed via client.connections.
Methods
| Method | HTTP | Endpoint |
|---|---|---|
get | GET | GET /connection/get/{id} |
delete | DELETE | DELETE /connection/delete/{id} |
list | GET | GET /connection/list |
getByType | — | derived |
search | — | derived |
get
Get a connection by ID
async get(connectionId: string)
Endpoint: GET /connection/get/{id} · API service
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the connection |
name | string | Name of the resource |
description | string | Connection description |
type | string | Connection type (database, API, etc.) |
host | string | Database host address |
port | string | Database port number (1-65535) |
username | string | Connection username |
passwordSecret | string | Encrypted password reference |
database | string | Database name |
schema | string | Database schema name |
ssl | boolean | Whether to use SSL connection |
ssh | boolean | Whether to use SSH tunnel |
sshHost | string | SSH host address |
sshPort | string | SSH tunnel port number (1-65535) |
sshUsername | string | SSH tunnel username |
sshPasswordSecret | string | SSH password reference |
workspaceID | string | Unique workspace identifier (UUID v4) |
createdBy | string | User ID who created the connection |
updatedBy | string | User ID who last updated the connection |
createdAt | string | Timestamp when this resource was created |
updatedAt | string | Timestamp when this resource was last updated |
Example
const result = await client.connections.get('agent-id');
delete
Delete a connection
async delete(connectionId: string): Promise<
Endpoint: DELETE /connection/delete/{id} · API service
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Operation success status |
data | object | Response data |
message | string | Optional success message |
Example
const result = await client.connections.delete('agent-id');
list
List all connections in the workspace
async list(limit?: number, offset?: number)
Endpoint: GET /connection/list · API service
Example
const result = await client.connections.list();
getByType
Get connections by type
async getByType(connectionType: string)
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
const result = await client.connections.getByType('…');
search
Search connections by name
async search(searchTerm: string)
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
const result = await client.connections.search('…');