Channels and voice
Channels: connect Slack, email, and HTTP webhooks to camelRun v2 agents
Create Slack, email, and HTTP channels at /v2/channels, route inbound messages to thread-keyed agents, and deliver signed outbound replies.
camelRun v2 channels route inbound messages from Slack, email, or HTTP into thread-keyed durable agents and deliver agent replies back to an outbound URL via a Cloudflare Queue.
Create a channel (POST /v2/channels)
ts
const channel = await client.channels.create({
kind: "slack", // "slack" | "email" | "http"
name: "support-slack",
definition: "support-triage",
outboundUrl: "https://hooks.slack.com/services/...",
secret: process.env.CHANNEL_WEBHOOK_SECRET!,
});Over REST
bash
# Create a channel
curl -s -X POST "https://run.camelai.com/v2/channels" \
-H "Authorization: Bearer $CAMELRUN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "http",
"name": "helpdesk-bridge",
"definition": "support-triage",
"agentConfig": {
"instructions": "Answer concisely in plain text."
},
"outboundUrl": "https://app.example.com/webhooks/agent-reply",
"secret": "whsec_channel_secret"
}'
# List channels
curl -s "https://run.camelai.com/v2/channels" \
-H "Authorization: Bearer $CAMELRUN_API_KEY"
# Delete a channel
curl -s -X DELETE "https://run.camelai.com/v2/channels/$CHANNEL_ID" \
-H "Authorization: Bearer $CAMELRUN_API_KEY"| Field | Type | Description |
|---|---|---|
kind | "slack" | "email" | "http" | Channel adapter type (defaults to "http") |
name | string | Human-readable channel name |
definition | string | Optional definition slug applied to agents created for this channel |
agentConfig | AgentUpsertInput | Optional overrides (model, instructions, tools, mcpServers, builtins, repoId, branch) merged over the definition |
outboundUrl | string | Optional default URL where replies are POSTed asynchronously |
secret | string | Optional secret sealed at rest, used to verify inbound signatures and sign outbound replies |
Inbound routing (POST /v2/channels/:id/inbound)
Send inbound events to POST https://run.camelai.com/v2/channels/<channelId>/inbound.
Authentication for inbound requests:
- Either pass
Authorization: Bearer <tenantApiKey>, OR - If the channel has a
secret, sign the raw JSON body with HMAC-SHA256 hex inX-CamelRun-Signature(orX-Slack-Signature).
Payload extraction by channel kind
| Kind | Thread ID fields (first match) | Prompt text fields | Dynamic reply URL override |
|---|---|---|---|
slack | event.thread_ts, event.ts, threadId, "default" | event.text, text, prompt | response_url |
email | inReplyTo, threadId, messageId, from, "default" | Optional Subject: <subject>\n\n + text / body / prompt | Uses channel outboundUrl |
http | threadId, conversationId, "default" | text, prompt, message | replyUrl |
- Slack URL verification: When
body.type === "url_verification"with achallengestring, camelRun immediately replies200 { "challenge": "..." }before signature/agent processing. - Thread-keyed agents: Each thread automatically maps to an agent keyed as
ch_<sanitizedChannelId>_<sanitizedThreadId>, so follow-up messages in the same thread continue the same conversation.
Sending an inbound message with the SDK
ts
const reply = await client.channels.sendInbound(channel.id, {
threadId: "ticket-982",
text: "How do I export my monthly invoice?",
});
console.log(reply);
// {
// ok: true,
// channelId: "ch_...",
// threadId: "ticket-982",
// agentId: "agt_...",
// agentKey: "ch_...",
// runId: "run_...",
// status: "completed",
// reply: "..."
// }Outbound reply delivery
When outboundUrl (or response_url / replyUrl on the inbound message) is set and the run produces reply text, camelRun enqueues an async outbound HTTP POST:
- For
slack, the JSON body is{ "text": replyText, "thread_ts": threadId }. - For
emailandhttp, the JSON body is{ "channelId", "kind", "threadId", "agentId", "runId", "text", "meta" }. - If the channel has a
secret, camelRun signs the outbound request withX-CamelRun-Signature: t=<unixSec>,v1=<hmacSha256Hex>over${timestamp}.${payload}.