Channels
Channels
toothfairyai@latest…Manager for channels operations.
This manager provides methods to create, update, and manage channels.
Example:
>>> client = ToothFairyClient(api_key="...", workspace_id="...")
>>> channel = client.channels.create(...)
Accessed via client.channels.
Methods
| Method | HTTP | Endpoint |
|---|---|---|
create | POST | POST /channel/create |
update | POST | POST /channel/update |
delete | DELETE | DELETE /channel/delete/{channel_id} |
get | GET | GET /channel/get/{channel_id} |
list | GET | GET /channel/list |
get_by_channel_type | — | derived |
get_active | — | derived |
search | — | derived |
create
Create a new channel.
def create(
name: str,
channel: str,
provider: str,
description: Optional[str] = None,
senderid: Optional[str] = None,
is_active: bool = True
) -> Channel
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 |
The Python SDK accepts
snake_casekeyword arguments and converts them to thecamelCasewire fields shown above.
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
client.channels.create(name="…", channel="…", provider="agent-id")
update
Update a channel.
def update(channel_id: str) -> Channel
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 |
The Python SDK accepts
snake_casekeyword arguments and converts them to thecamelCasewire fields shown above.
Response
Returns the Channel object — fields documented in the create section above.
Example
client.channels.update(channel_id="agent-id")
delete
Delete a channel.
def delete(channel_id: str) -> Dict[str, bool]
Endpoint: DELETE /channel/delete/{channel_id} · API service
Example
client.channels.delete(channel_id="agent-id")
get
Get a channel by ID.
def get(channel_id: str) -> Channel
Endpoint: GET /channel/get/{channel_id} · API service
Response
Returns the Channel object — fields documented in the create section above.
Example
client.channels.get(channel_id="agent-id")
list
List all channels.
def list(
limit: Optional[int] = None,
offset: Optional[int] = None
) -> ListResponse
Endpoint: GET /channel/list · API service
Example
client.channels.list()
get_by_channel_type
Get channels by type.
def get_by_channel_type(channel_type: str) -> List[Channel]
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
client.channels.get_by_channel_type(channel_type="…")
get_active
Get all active channels.
def get_active() -> List[Channel]
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
client.channels.get_active()
search
Search channels by name.
def search(search_term: str) -> List[Channel]
Derived method — delegates to another SDK call and performs no direct HTTP request.
Example
client.channels.search(search_term="…")