Channels
Channels
@toothfairyai/sdk@latest…Channel Management Module Handles channel CRUD operations for communication channels.
Accessed via client.channels.
Methods
| Method | HTTP | Endpoint |
|---|---|---|
create | POST | POST /channel/create |
update | POST | POST /channel/update |
delete | DELETE | DELETE /channel/delete/{id} |
get | GET | GET /channel/get/{id} |
list | GET | GET /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
| Field | Type | Required | Description |
|---|---|---|---|
id | string | no | Unique identifier |
workspaceid | string | yes | Unique workspace identifier (UUID v4) |
name | string | yes | Name of the resource |
description | string | no | Detailed description of purpose and capabilities |
channel | string | yes | Communication 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
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the channel |
workspaceID | string | Unique workspace identifier (UUID v4) |
name | string | Name of the resource |
description | string | Channel description |
channel | string | Communication 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
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | Unique identifier |
workspaceid | string | no | Unique workspace identifier (UUID v4) |
name | string | no | Name of the resource |
description | string | no | Detailed description of purpose and capabilities |
channel | string | no | Communication 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();