Channels

Connect the rails

A channel goes live in three calls: create a provider account with your credentials, validate it against the live provider, then register the inbound webhook. Credentials are encrypted at rest and never come back out.

Supported channels

ChannelInbound endpointSelf-serve webhook register
WhatsApp/inbound/whatsappYes — subscribes your Meta app + WABA via the Graph API
Telegram/inbound/telegramYes
Discord/inbound/discordYes
Slack/inbound/slackYes
SMS (Twilio)/inbound/smsYes
RCS/inbound/rcsYes
Email (Gmail)/inbound/mail + OAuth (/oauth/gmail/start) and a polling workerNo — connect via Gmail OAuth; inbound arrives by poll
Microsoft Teams/inbound/teamsNo — configure the webhook in your Teams app manually

GET /health reports which channels are live on your deployment: { "channels": ["whatsapp", "telegram", …] }. Channels can be configured globally via environment (single-tenant style) or per workspace via provider accounts — a workspace's own provider accounts take precedence over environment providers.

Provider accounts

A provider_account binds one channel provider (with its credentials) to your workspace. Lifecycle: draftready (after validation) or error. Editing credentials resets it to draft.

1. Create

POST/provider-accountsrequires full scope
create a whatsapp account
curl -X POST "$AGENTPUSH_URL/provider-accounts" \
  -H "Authorization: Bearer apk_…" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "whatsapp",
    "label": "Support line FR",
    "credentials": {
      "token": "EAAG…",
      "phoneNumberId": "1065…",
      "businessAccountId": "1122…",
      "appId": "8433…",
      "appSecret": "f0e1…",
      "webhookVerifyToken": "a-random-string-you-choose"
    }
  }'
// → 201 { "account": { "id": "…", "provider": "whatsapp", "status": "draft", … } }

2. Validate

POST/provider-accounts/:id/validate
validate
curl -X POST "$AGENTPUSH_URL/provider-accounts/$ACCOUNT_ID/validate" \
  -H "Authorization: Bearer apk_…"
// → { "status": "ready" }        credentials work against the live provider
// → { "status": "error", … }     credentials rejected — fix and PATCH

Validation resolves the channel driver with your decrypted credentials and exercises them against the live provider. Success flips the account to ready; failure records error. For Slack it also captures the teamId used to route inbound events.

3. Register the webhook

POST/provider-accounts/:id/webhook/register
register
curl -X POST "$AGENTPUSH_URL/provider-accounts/$ACCOUNT_ID/webhook/register" \
  -H "Authorization: Bearer apk_…"
// WhatsApp example response:
// → { "callbackUrl": "https://…/inbound/whatsapp", "tunnel": false, "subscribedWaba": true }

Available for whatsapp, telegram, discord, sms, rcs and slack. agentpush resolves its own public base URL (falling back to a dev tunnel locally — the response's tunnel flag tells you which), then registers the correct callback with the provider:

  • WhatsApp — subscribes your Meta app to messages events (Graph API /subscriptions) and, when businessAccountId is set, subscribes the WABA (/subscribed_apps). Requires token, phoneNumberId, appId, appSecret and webhookVerifyToken.
  • Telegram — registers the bot webhook (requires the bot token; a webhookSecret is used to authenticate deliveries when set).
  • Other providers — analogous per-provider flows; a provider without self-serve registration returns 400.

Manage

GET/provider-accountslist (credentials stripped)
PATCH/provider-accounts/:idupdate label / credentials → back to draft
DELETE/provider-accounts/:idrevokes the stored secret, then deletes

Once an account is ready and its webhook registered, outbound sends pick it up automatically and inbound messages start flowing into the routing engine — continue with Inbound & BYO inference.