Skip to main content

Connections

Connections​

@toothfairyai/sdk@latest…

Connection Management Module Handles connection CRUD operations for external integrations.

Accessed via client.connections.

Methods​

MethodHTTPEndpoint
getGETGET /connection/get/{id}
deleteDELETEDELETE /connection/delete/{id}
listGETGET /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​

FieldTypeDescription
idstringUnique identifier for the connection
namestringName of the resource
descriptionstringConnection description
typestringConnection type (database, API, etc.)
hoststringDatabase host address
portstringDatabase port number (1-65535)
usernamestringConnection username
passwordSecretstringEncrypted password reference
databasestringDatabase name
schemastringDatabase schema name
sslbooleanWhether to use SSL connection
sshbooleanWhether to use SSH tunnel
sshHoststringSSH host address
sshPortstringSSH tunnel port number (1-65535)
sshUsernamestringSSH tunnel username
sshPasswordSecretstringSSH password reference
workspaceIDstringUnique workspace identifier (UUID v4)
createdBystringUser ID who created the connection
updatedBystringUser ID who last updated the connection
createdAtstringTimestamp when this resource was created
updatedAtstringTimestamp 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​

FieldTypeDescription
successbooleanOperation success status
dataobjectResponse data
messagestringOptional 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 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('…');