Developers

Build with the Agent Channels API

TypeScript SDK, REST API, WebSocket streaming, and webhook integrations. Ship multi-platform agents in minutes.

01

Create an identity

Register an agent on any platform with a single API call.

create-identity.ts
1import { AgentChannels } from "@agentchannels/sdk"
2 
3const ac = new AgentChannels({
4 apiKey: process.env.AC_API_KEY,
5})
6 
7const identity = await ac.identities.create({
8 platform: "slack",
9 type: "bot",
10 displayName: "Support Agent",
11})
12 
13console.log("Identity ID:", identity.id)
14console.log("Status:", identity.status)

02

Send a message

Send messages to any platform through the unified API.

send-message.ts
1// Send a message on any platform
2await ac.messages.send({
3 identityId: "id_...",
4 conversationId: "conv_...",
5 body: "How can I help you today?",
6})
7 
8// Send with rich formatting
9await ac.messages.send({
10 identityId: "id_...",
11 conversationId: "conv_...",
12 body: "Check out our **documentation**",
13 formattedBody: "<p>Check out our <b>documentation</b></p>",
14})

03

Listen for events

Stream real-time events via WebSocket.

events.ts
1import { AgentChannelsSocket } from "@agentchannels/sdk"
2 
3const socket = new AgentChannelsSocket({
4 apiKey: process.env.AC_API_KEY,
5})
6 
7socket.on("message.received", (event) => {
8 console.log(`[${event.platform}] ${event.body}`)
9})
10 
11socket.on("reaction.added", (event) => {
12 console.log(`Reaction: ${event.emoji}`)
13})
14 
15socket.on("typing.started", (event) => {
16 console.log(`${event.userId} is typing...`)
17})
18 
19await socket.connect()

04

Set up webhooks

Receive events via HTTP with automatic retries.

webhooks.ts
1// Register a webhook endpoint
2const webhook = await ac.webhooks.create({
3 url: "https://your-app.com/api/webhooks/ac",
4 events: [
5 "message.received",
6 "message.sent",
7 "identity.connected",
8 "reaction.added",
9 ],
10})
11 
12console.log("Webhook ID:", webhook.id)
13console.log("Signing secret:", webhook.secret)
14 
15// Verify webhook signatures in your handler
16import { verifySignature } from "@agentchannels/sdk"
17 
18export async function POST(req: Request) {
19 const body = await req.text()
20 const sig = req.headers.get("x-ac-signature")
21 if (!verifySignature(body, sig, webhook.secret)) {
22 return new Response("Invalid", { status: 401 })
23 }
24 // Handle the event...
25}

Resources

API Reference

Complete REST API documentation with OpenAPI 3.1 spec.

Coming soon

TypeScript SDK

Auto-generated SDK with full type safety.

Coming soon

WebSocket Events

AsyncAPI 3.0 spec for real-time event streaming.

Coming soon

Webhook Reference

50+ event types with payload schemas and retry docs.

Coming soon

Ready to connect
your agents?

Join the beta. Get priority support, referral perks, and early access to every new platform integration.