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_typederived
get_activederived
searchderived

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

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 |

The Python SDK accepts snake_case keyword arguments and converts them to the camelCase wire fields shown above.

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

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 |

The Python SDK accepts snake_case keyword arguments and converts them to the camelCase wire 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 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="…")