Deploying Agents

Deploy your BlueNexus agents to messaging platforms — Telegram, WhatsApp, and web chat.

Required scope: messaging-channels

Messaging Channels

A messaging channel connects an agent to a platform. Users interact with the agent through the platform's native interface.

Create a Channel

curl -X POST https://api.bluenexus.ai/api/v1/messaging-channels \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "telegram",
    "agentId": "agent-abc123",
    "config": {
      "botToken": "YOUR_TELEGRAM_BOT_TOKEN"
    }
  }'

Supported Platforms

Platform Type Configuration
Telegram telegram Bot token from BotFather
WhatsApp whatsapp WhatsApp Business API credentials
Web Chat webchat No external config needed

Telegram

  1. Create a bot with @BotFather on Telegram
  2. Copy the bot token
  3. Create a messaging channel:
curl -X POST https://api.bluenexus.ai/api/v1/messaging-channels \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "telegram",
    "agentId": "agent-abc123",
    "config": {
      "botToken": "123456:ABCdefGHIjklMNOpqrsTUVwxyz"
    }
  }'

BlueNexus registers the webhook with Telegram automatically. Users can start chatting with your bot immediately.

WhatsApp

Requires a WhatsApp Business API setup:

curl -X POST https://api.bluenexus.ai/api/v1/messaging-channels \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "whatsapp",
    "agentId": "agent-abc123",
    "config": {
      "phoneNumberId": "YOUR_PHONE_NUMBER_ID",
      "accessToken": "YOUR_WHATSAPP_ACCESS_TOKEN",
      "verifyToken": "YOUR_VERIFY_TOKEN"
    }
  }'

Web Chat

For embedding a chat widget in your website:

curl -X POST https://api.bluenexus.ai/api/v1/messaging-channels \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "webchat",
    "agentId": "agent-abc123"
  }'

Send messages to the webchat endpoint:

curl -X POST https://api.bluenexus.ai/api/v1/messaging-channels/webchat/messages \
  -H "Content-Type: application/json" \
  -d '{
    "channelId": "channel-xyz",
    "message": "What are my tasks for today?"
  }'

Managing Channels

# List channels
curl https://api.bluenexus.ai/api/v1/messaging-channels \
  -H "Authorization: Bearer ACCESS_TOKEN"

# Get a channel
curl https://api.bluenexus.ai/api/v1/messaging-channels/CHANNEL_ID \
  -H "Authorization: Bearer ACCESS_TOKEN"

# Update a channel
curl -X PUT https://api.bluenexus.ai/api/v1/messaging-channels/CHANNEL_ID \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"agentId": "agent-new-id"}'

# Delete a channel
curl -X DELETE https://api.bluenexus.ai/api/v1/messaging-channels/CHANNEL_ID \
  -H "Authorization: Bearer ACCESS_TOKEN"

Linking User Accounts

Connect a user's BlueNexus account to a messaging channel so the agent can access their connected services:

curl -X POST https://api.bluenexus.ai/api/v1/messaging-channels/CHANNEL_ID/link-account \
  -H "Authorization: Bearer ACCESS_TOKEN"

Next Steps