Skip to main content

Channels

Channels

@toothfairyai/sdk@latest…

Channel Management Module Handles channel CRUD operations for communication channels.

Accessed via client.channels.

Methods

MethodHTTPEndpoint
createPOSTPOST /channel/create
updatePOSTPOST /channel/update
deleteDELETEDELETE /channel/delete/{id}
getGETGET /channel/get/{id}
listGETGET /channel/list

create

Create a new channel

async create(
name: string,
channel: string,
provider: string,
options: {
senderId?: string;
description?: string;
isActive?: boolean;
} = {}
)

Endpoint: POST /channel/create · API service

Request fields

FieldTypeRequiredDescription
idstringnoUnique identifier
workspaceidstringyesUnique workspace identifier (UUID v4)
namestringyesName of the resource
descriptionstringnoDetailed description of purpose and capabilities
channelstringyesCommunication channel type: sms, whatsapp, or email

Allowed: sms, whatsapp, email | | provider | string | yes | Communication provider: twilio, sms_magic, sms_magic_sf, whatsapp, or ses

Allowed: twilio, sms_magic, sms_magic_sf, whatsapp, ses | | isActive | boolean | no | Whether the job is currently active | | config | string | no | JSON-encoded channel configuration | | sipTrunkId | string | no | SIP trunk identifier for voice channels | | createdBy | string | no | ID of the user who created this resource | | updatedBy | string | no | ID of the user who last updated this resource | | senderid | string | no | Sender ID for SMS/WhatsApp channels | | fromNumber | string | no | From phone number for SMS/WhatsApp channels | | tokenSecret | string | no | Secret reference ID for the token/credential |

Response fields

FieldTypeDescription
idstringUnique identifier for the channel
workspaceIDstringUnique workspace identifier (UUID v4)
namestringName of the resource
descriptionstringChannel description
channelstringCommunication channel type

Allowed: email, sms, whatsapp, linkedin, sip | | provider | string | Service provider

Allowed: sendgrid, ses, mailgun, postmark, mailjet, twilio, whatsapp, sms_magic, sms_magic_sf, linkedin | | senderid | string | Sender ID for SMS/WhatsApp channels | | fromNumber | string | From phone number for SMS/WhatsApp channels | | tokenSecret | string | Secret reference ID for the token/credential | | sipTrunkId | string | SIP trunk identifier for voice channels | | isActive | boolean | Whether the channel is active | | config | object | JSON-encoded channel configuration | | createdBy | string | ID of the user who created this resource | | updatedBy | string | ID of the user who last updated this resource | | createdAt | string | Timestamp when this resource was created | | updatedAt | string | Timestamp when this resource was last updated |

Example

const result = await client.channels.create('…', '…', 'agent-id');

update

Update an existing channel

async update(
channelId: string,
options: {
name?: string;
channel?: string;
provider?: string;
senderId?: string;
description?: string;
isActive?: boolean;
} = {}
)

Endpoint: POST /channel/update · API service

Request fields

FieldTypeRequiredDescription
idstringyesUnique identifier
workspaceidstringnoUnique workspace identifier (UUID v4)
namestringnoName of the resource
descriptionstringnoDetailed description of purpose and capabilities
channelstringnoCommunication channel type: sms, whatsapp, or email

Allowed: sms, whatsapp, email | | provider | string | no | Communication provider: twilio, sms_magic, sms_magic_sf, whatsapp, or ses

Allowed: twilio, sms_magic, sms_magic_sf, whatsapp, ses | | isActive | boolean | no | Whether the job is currently active | | config | string | no | JSON-encoded channel configuration | | sipTrunkId | string | no | SIP trunk identifier for voice channels | | createdBy | string | no | ID of the user who created this resource | | updatedBy | string | no | ID of the user who last updated this resource | | senderid | string | no | Sender ID for SMS/WhatsApp channels | | fromNumber | string | no | From phone number for SMS/WhatsApp channels | | tokenSecret | string | no | Secret reference ID for the token/credential |

Response

Returns the Channel object — fields documented in the create section above.

Example

const result = await client.channels.update('agent-id');

delete

Delete a channel

async delete(channelId: string): Promise<

Endpoint: DELETE /channel/delete/{id} · API service

Example

const result = await client.channels.delete('agent-id');

get

Get a channel by ID

async get(channelId: string)

Endpoint: GET /channel/get/{id} · API service

Response

Returns the Channel object — fields documented in the create section above.

Example

const result = await client.channels.get('agent-id');

list

List all channels in the workspace

async list(limit?: number, offset?: number)

Endpoint: GET /channel/list · API service

Example

const result = await client.channels.list();