Skip to content

Channels API

Base path: /api/channels

All endpoints require authentication. See API Overview for auth details.

Supported platforms: discord, telegram, slack, whatsapp, teams, google_chat

GET /api/channels

Response:

{
"platforms": [
{
"id": "slack",
"name": "Slack",
"credentials_stored": true,
"status": "connected",
"bound_agent": "agent_123",
"binding_count": 3,
"credentials_preview": "bot_token: xoxb-****-1234"
},
{
"id": "discord",
"name": "Discord",
"credentials_stored": false,
"status": "not_configured",
"bound_agent": null,
"binding_count": 0,
"credentials_preview": null
}
]
}

Platform statuses: connected, not_configured, error

GET /api/channels/{platform}
POST /api/channels/{platform}/credentials

Required credential fields by platform:

PlatformFields
discordbot_token, public_key, application_id
telegrambot_token, webhook_secret
slacksigning_secret, bot_token, socket_mode (optional bool)
whatsappphone_number_id, access_token
teamsapp_id, app_password
google_chatservice_account_json (full JSON string)

Example (Slack):

{
"signing_secret": "abc123...",
"bot_token": "xoxb-...",
"socket_mode": false
}

Response:

{"preview": "signing_secret: abc1****3456; bot_token: xoxb-****-1234"}

Credentials are encrypted at rest using Fernet with PBKDF2-HMAC-SHA256 (600,000 iterations).

DELETE /api/channels/{platform}/credentials
POST /api/channels/{platform}/test

Tests the channel connection with the stored credentials.

A binding maps a platform channel to a Snippbot agent.

GET /api/channels/bindings

Query: platform

Response:

{
"bindings": [
{
"id": "bind_abc123",
"platform": "slack",
"channel_id": "C0123456789",
"channel_name": "#engineering",
"agent_id": "agent_123",
"access_mode": "open",
"enabled": true,
"created_at": "2026-01-01T00:00:00Z"
}
]
}
POST /api/channels/bindings
{
"platform": "slack",
"channel_id": "C0123456789",
"channel_name": "#engineering",
"agent_id": "agent_123",
"access_mode": "open"
}

Access modes:

  • open — any user in the channel can interact
  • allowlist — only approved users
  • admin_only — only users with admin role in the binding

Returns 201 with the binding object.

PUT /api/channels/bindings/{id}
{"access_mode": "allowlist", "enabled": false}
DELETE /api/channels/bindings/{id}

Manage which users are allowed to interact with a bound agent.

GET /api/channels/access
POST /api/channels/access
{
"platform_user_id": "U0123456789",
"role": "user"
}

Roles: user, admin

DELETE /api/channels/access/{id}
GET /api/channels/server/status

Response:

{
"running": true,
"pid": 12345,
"uptime_seconds": 86400,
"connected_platforms": ["slack", "telegram"],
"messages_received": 1247,
"messages_sent": 1189
}
POST /api/channels/server/start

Starts the channel server subprocess (equivalent to snippbot channel start).

POST /api/channels/server/stop
GET /api/channels/settings
PUT /api/channels/settings

Response:

{
"adapter_port": 18790,
"rate_limit_per_minute": 30,
"rate_limit_per_hour": 500,
"proactive_enabled": false,
"quiet_hours_start": "22:00",
"quiet_hours_end": "08:00",
"max_proactive_per_hour": 5,
"public_url": "https://snippbot.example.com"
}