Skip to main content

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​

MethodHTTPEndpoint
createPOSTPOST /channel/create
updatePOSTPOST /channel/update
deleteDELETEDELETE /channel/delete/{channel_id}
getGETGET /channel/get/{channel_id}
listGETGET /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​

Python kwargWire fieldTypeRequiredDescription
ididstringnoUnique identifier
workspace_idworkspaceidstringyesUnique workspace identifier (UUID v4)
namenamestringyesName of the resource
descriptiondescriptionstringnoDetailed description of purpose and capabilities
channelchannelstringyesCommunication channel type: sms, whatsapp, or email

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

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

Always pass snake_case keyword arguments — the Python kwarg column shows the exact name to use for each wire field (as a named parameter where it appears in the method signature, otherwise via **kwargs). The SDK converts it deterministically to the camelCase wire key the API expects. Passing camelCase directly is deprecated: it emits a warning and converts to the same wire key.

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​

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​

Python kwargWire fieldTypeRequiredDescription
ididstringyesUnique identifier
workspace_idworkspaceidstringnoUnique workspace identifier (UUID v4)
namenamestringnoName of the resource
descriptiondescriptionstringnoDetailed description of purpose and capabilities
channelchannelstringnoCommunication channel type: sms, whatsapp, or email

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

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

Always pass snake_case keyword arguments — the Python kwarg column shows the exact name to use for each wire field (as a named parameter where it appears in the method signature, otherwise via **kwargs). The SDK converts it deterministically to the camelCase wire key the API expects. Passing camelCase directly is deprecated: it emits a warning and converts to the same wire key.

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 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="…")