Channels
Deliver agents to end users via embeddable chat widgets, Slack, email, or phone. Agents meet users where they are — and every channel is AgentCo-branded.
Chat embed
Add a chat widget to any website with a single script tag. Customize colors, position, title, and placeholder text to match your brand.
import { Theazo } from class="cb-str">'theazo'
const theazo = new Theazo({ apiKey: class="cb-str">'th_live_...' })
const widget = await theazo.channels.chatEmbed({
agent: class="cb-str">'support_agent',
theme: {
primaryColor: class="cb-str">'#6366f1',
position: class="cb-str">'bottom-right',
title: class="cb-str">'AI Support',
placeholder: class="cb-str">'Ask anything...',
},
})
console.log(widget.id) class="cb-cmt">// 'ch_abc'
console.log(widget.scriptTag)
// ''Drop the scriptTag into any HTML page. The widget handles conversation creation, message streaming, and reconnection automatically.
Slack
Connect an agent to one or more Slack channels. The bot listens for messages, runs the agent, and replies in-thread.
await theazo.channels.slack({
agent: class="cb-str">'team_assistant',
workspace: class="cb-str">'T01234567',
channels: [class="cb-str">'#general', class="cb-str">'#support'],
botName: class="cb-str">'Acme Bot',
})
// Bot appears in Slack as "Acme Bot"
// Responds to @mentions and DMschat:write, app_mentions:read, and channels:history scopes. Configure the OAuth redirect URL in your Theazo dashboard under Settings.Route incoming emails to an agent. The agent processes the email content and sends a response from your domain.
await theazo.channels.email({
agent: class="cb-str">'email_handler',
address: class="cb-str">'support@yourproduct.com',
})
// Incoming emails to support@yourproduct.com trigger the agent
// Agent reads the email, processes it, and sends a replyConfigure DNS records (MX, SPF, DKIM) for your domain in Settings to enable email receiving. Theazo handles parsing, threading, and attachment extraction.
Phone
Connect a phone number to an agent for voice conversations. Powered by Twilio for telephony and real-time voice synthesis.
await theazo.channels.phone({
agent: class="cb-str">'phone_agent',
phoneNumber: class="cb-str">'+1234567890',
voice: class="cb-str">'alloy',
})
// Incoming calls to +1234567890 connect to the agent
// Agent speaks using the selected voice modelManaging channels
List channels
const channels = await theazo.channels.list()
// channels = [
// { id: 'ch_001', type: 'chat_embed', enabled: true, conversationCount: 1243 },
// { id: 'ch_002', type: 'slack', enabled: true, conversationCount: 872 },
// { id: 'ch_003', type: 'email', enabled: true, conversationCount: 3456 },
// { id: 'ch_004', type: 'phone', enabled: false, conversationCount: 567 },
// ]Update a channel
await theazo.channels.update(class="cb-str">'ch_001', {
config: {
theme: {
primaryColor: class="cb-str">'#10b981',
title: class="cb-str">'Help Center',
},
},
})Disable and enable
Disabling a channel stops it from accepting new conversations. Existing conversations are not affected.
// Disable — stops accepting new conversations
await theazo.channels.disable(class="cb-str">'ch_001')
// Re-enable
await theazo.channels.enable(class="cb-str">'ch_001')View conversations
const conversations = await theazo.channels.conversations(class="cb-str">'ch_001')
// conversations = [
// { id: 'conv_01', userId: 'user_42', messageCount: 12, ... },
// { id: 'conv_02', userId: 'user_99', messageCount: 3, ... },
// ]Test a channel
Send a test message through a channel to verify it's configured correctly.
const result = await theazo.channels.test(class="cb-str">'ch_001')
console.log(result.ok) class="cb-cmt">// true
console.log(result.message) class="cb-cmt">// 'Test message sent via chat_embed'Delete a channel
await theazo.channels.delete(class="cb-str">'ch_001')
// Channel is permanently removed
// Existing conversations are preserved in logsAPI reference
theazo.channels.chatEmbed(opts)Promise<Channel>Create a chat embed widget. Returns channel with scriptTag for embedding.theazo.channels.slack(opts)Promise<Channel>Connect an agent to Slack channels. Requires workspace ID and channel names.theazo.channels.email(opts)Promise<Channel>Route emails to an agent. Requires a configured email address.theazo.channels.phone(opts)Promise<Channel>Connect a phone number to an agent. Requires Twilio integration.theazo.channels.list()Promise<Channel[]>List all channels for the platform.theazo.channels.get(id)Promise<Channel>Get a channel by ID.theazo.channels.update(id, opts)Promise<Channel>Update channel config or enabled status.theazo.channels.disable(id)Promise<Channel>Disable a channel. Stops accepting new conversations.theazo.channels.enable(id)Promise<Channel>Re-enable a disabled channel.theazo.channels.delete(id)Promise<void>Permanently delete a channel.theazo.channels.conversations(id)Promise<Conversation[]>List conversations for a channel.theazo.channels.test(id)Promise<TestResult>Send a test message through the channel.REST endpoints
/v1/channelsCreate a channel (type discriminates config shape)/v1/channelsList all channels/v1/channels/:idGet channel by ID/v1/channels/:idUpdate channel config or enabled status/v1/channels/:idDelete a channel/v1/channels/:id/conversationsList conversations for a channel/v1/channels/:id/testSend a test message