Skip to content

Channels (Messaging Integrations)

Channels connect your Universal API agents to messaging platforms — Slack, Discord, Telegram, WhatsApp, and generic webhooks. Once configured, users on those platforms can chat with your agent directly.

How Channels Work

  1. Create a channel — Specify the platform, agent, and platform credentials
  2. Get a webhook URL — Universal API generates a unique inbound webhook
  3. Configure the platform — Point your bot's webhook to the URL
  4. Users chat — Messages flow in, agent responds, replies flow back
User (Slack/Discord/etc.) → Platform Webhook → Universal API → Agent → Response → Platform

Supported Platforms

PlatformAuth RequiredGroup SupportFeatures
SlacksigningSecret + botTokenThreads, mentions, allowlists
DiscordpublicKey + botTokenThreads, mentions, allowlists
TelegrambotTokenAuto-registers webhook with Telegram API
WhatsAppverifyToken + accessToken + phoneNumberIdMeta webhook verification
Twilio VoiceaccountSid + authToken + phoneNumberInbound + outbound phone calls
Webhooksecret (optional)Generic HTTP webhook with HMAC verification

Quick Start

1. Create a Channel

bash
curl -X POST https://api.universalapi.co/channels \
  -H "Authorization: Bearer uapi_ut_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-slack-bot",
    "platform": "slack",
    "agentId": "YOUR_AGENT_ID",
    "platformConfig": {
      "signingSecret": "your_slack_signing_secret",
      "botToken": "xoxb-your-slack-bot-token"
    }
  }'

The response includes a webhookUrl — configure this in your platform's bot settings.

2. Configure Your Platform

Slack: Go to your Slack App → Event Subscriptions → set the Request URL to the webhookUrl.

Discord: Go to your Discord App → General Information → set the Interactions Endpoint URL.

Telegram: The webhook is auto-registered when you create the channel — no manual setup needed!

WhatsApp: In Meta Business Suite → WhatsApp → Configuration → set the Callback URL.

3. Test It

bash
curl -X POST https://api.universalapi.co/channels/{channelId}/test \
  -H "Authorization: Bearer uapi_ut_your_token" \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello! Are you working?"}'

Security Features

Platform Signature Verification

Every inbound webhook is verified using the platform's native signature mechanism:

  • Slack: HMAC-SHA256 with signing secret
  • Discord: Ed25519 signature verification
  • Telegram: Secret token header validation
  • WhatsApp: SHA256 HMAC verification
  • Webhook: Optional HMAC with shared secret

Sender Allowlists

Restrict which users can interact with your agent:

json
{
  "allowedSenders": ["U12345678", "U87654321"]
}

Group Policies

Control how the agent behaves in group chats:

PolicyBehavior
disabledIgnore all group messages (DMs only)
allowlistOnly respond in specified groups
openRespond in all groups

Mention Gating

Set requireMention: true to only respond when the bot is @mentioned in groups.

Conversation Continuity

Channels automatically map platform threads/groups/DMs to Universal API conversation IDs. This means:

  • Multi-turn conversations work naturally
  • Context is preserved within a thread
  • Each DM or thread gets its own conversation

Auto-Pause

If a channel encounters 3 consecutive failures, it's automatically paused (status → error) to prevent runaway errors. Reactivate by updating the status:

bash
curl -X PUT https://api.universalapi.co/channels/{channelId} \
  -H "Authorization: Bearer uapi_ut_your_token" \
  -H "Content-Type: application/json" \
  -d '{"status": "active"}'

Billing

Channels use normal agent invocation credits — no additional channel charges. Each message that triggers an agent response costs the standard agent credits based on token usage.

Universal API - The agentic entry point to the universe of APIs