Docs Notification Channels

Notification Channels

Mockarty supports sending notifications through external messaging services — Telegram, Slack, Discord, Microsoft Teams, and others. This allows users to receive real-time alerts about test results, fuzzing findings, contract drift, and system events directly in their preferred messenger.

Architecture

The notification system uses a two-level model:

  1. Admin configures system-wide notification channels (e.g., “Corporate Slack”, “Telegram Bot”)
  2. Users connect to available channels and configure which events they want to receive

Additionally, the AI agent can use system channels to send notifications without requiring users to provide credentials.

ADMIN Notification Channels Config Add / Edit Test / Delete configures SYSTEM CHANNELS Telegram Slack Discord Teams + PagerDuty, OpsGenie, Webex... USER Settings → My Channels Connect Preferences binds EVENT BUS test.run.completed | fuzzing.finding.new | contract.drift_detected | system.alert CHANNEL DISPATCHER routes events → user bindings → channel senders check preferences Telegram Slack Discord Teams PagerDuty Webhook ... AI Agent send_via_channel direct send

Supported Channels

Channel Type How it works
Telegram Bot API Admin creates a bot via @BotFather, users connect via deeplink
Slack Bot Token / Webhook DM via bot token + email lookup, or channel webhook
Discord Webhook Channel-level webhook, no per-user binding needed
Microsoft Teams Workflow Webhook Adaptive Card via Power Automate Workflow webhook
Mattermost Webhook Slack-compatible incoming webhook
Rocket.Chat Webhook Slack-compatible incoming webhook
Пачка (Pachca) Bot API Direct messages via the Pachca bot API
VK Teams Bot API Messages via the VK Teams Bot API (self-hosted API address supported)
PagerDuty Events API v2 Creates incidents for critical alerts
OpsGenie Alert API Creates alerts with priority mapping
Google Chat Webhook Space-level webhook
Webex Bot API DM via bot token + email
Generic Webhook HTTP POST Custom URL with optional HMAC signature

Admin Setup

Adding a Channel

  1. Go to Admin Panel → Notification Channels
  2. Click Add Channel
  3. Select the channel type
  4. Fill in the configuration (follow the setup hints shown for each type)
  5. (Optional) Set Namespace — leave empty to make the channel global (visible in every namespace) or enter a specific namespace name to scope it. The field is safe to change later via update.
  6. Click Save
  7. Use Test button to verify connectivity

Updating a Channel (secrets-safe)

When editing an existing channel, you don’t need to re-enter tokens, webhook URLs, or other sensitive fields — the UI sends an empty string for fields you leave blank and the server keeps the previously stored value for them. Only fields you actively fill in get overwritten. This lets you rename a channel, flip its enabled state, or move it between namespaces without ever exposing its secrets again.

Admin audit log

Every admin-initiated channel change is recorded in the audit log (visible in Admin Panel → Audit Log). Three action codes identify the events:

Action When it fires Captured fields
create_notification_channel New channel persisted type, name, enabled, actor, IP, namespace
update_notification_channel Channel PUT succeeded type, name, enabled, actor, IP, namespace
delete_notification_channel Channel DELETE succeeded type, name (snapshot taken before delete), actor, IP, namespace

Secret fields (bot tokens, webhook URLs, passwords) are never written to the audit log — only the public metadata is captured. Use this log to trace who configured a channel, when it was disabled, or which admin removed a target that stopped receiving alerts.

Channel Configuration Examples

Telegram

  1. Open Telegram, find @BotFather
  2. Send /newbot, follow the prompts to create a bot
  3. Copy the bot token (format: 123456789:ABCdef...)
  4. In Mockarty Admin → Channels → Add → Telegram:
    • Bot Token: paste the token
    • Bot Username: @YourBotName (optional, for display)
  5. Save and enable

Users will connect by clicking a deeplink that opens the bot in Telegram.

Slack

Option A: Bot Token (recommended for DMs)

  1. Go to api.slack.com/apps → Create New App
  2. Add Bot Token Scopes: chat:write, users:read.email
  3. Install to workspace, copy the Bot Token (xoxb-...)
  4. In Mockarty: paste as Bot Token

Users enter their Slack email to receive DMs.

Option B: Incoming Webhook (channel-level)

  1. In Slack App → Incoming Webhooks → Add New Webhook
  2. Select a channel, copy the URL
  3. In Mockarty: paste as Webhook URL

Discord

  1. In Discord: Server Settings → Integrations → Webhooks → New Webhook
  2. Select a channel, copy the webhook URL
  3. In Mockarty: paste as Webhook URL

No per-user binding needed — messages go to the channel.

Microsoft Teams

  1. In Teams channel: click ... → Workflows
  2. Select “Post to a channel when a webhook request is received”
  3. Follow the setup wizard, copy the webhook URL
  4. In Mockarty: paste as Webhook URL

Note: Legacy Office 365 Connector URLs are being retired. Use Workflows (Power Automate) webhooks.

PagerDuty

  1. In PagerDuty: Services → select service → Integrations tab
  2. Add Integration → Events API v2
  3. Copy the Integration Key
  4. In Mockarty: paste as Integration Key (routing_key)
  5. Optional: set Severity — one of critical, error, warning, info (defaults are applied per event type if omitted)

OpsGenie

  1. In OpsGenie: Teams → select team → Integrations → Add integration → API
  2. Copy the API Key
  3. In Mockarty: paste as API Key
  4. Select Regionus (api.opsgenie.com) or eu (api.eu.opsgenie.com). Using the wrong region causes silent delivery failures.

Testing a Channel

After saving, click the Test button on any channel to send a test notification. For channels that require a recipient (Telegram, Slack), you’ll need to provide a chat ID or email.

User Setup

Connecting to Channels

  1. Go to Settings → My Notification Channels
  2. Available channels configured by admin are listed under Available Channels
  3. Click Connect on the desired channel

Telegram Connection

  1. Click Connect on the Telegram channel
  2. A deeplink opens – click it to go to the bot in Telegram
  3. Press Start in the bot chat
  4. Connection is confirmed automatically

Slack Connection

  1. Click Connect on the Slack channel
  2. Enter your Slack workspace email
  3. Mockarty resolves your Slack user ID and sends DMs directly

Webhook Channels (Discord, Teams, etc.)

These are channel-level — click Connect and you’re done. All users connected to the same channel receive the same messages.

Notification Preferences Matrix

After connecting, configure which events trigger notifications. The preferences matrix lists every channel-deliverable event (dozens of them), grouped by category — test runs, performance, fuzzing, contracts, chat mentions and direct messages, meetings, task tracker, reviews, license and system alerts. Each channel column has an “All” toggle to switch the whole channel on or off in one click, and every event can be enabled or disabled per channel individually.

A few examples of canonical event IDs:

Event ID Description
test.run.completed API test collection run finished
perf.test.failed Performance / load test could not run to completion
perf.test.threshold_breach Performance / load test finished, but one or more thresholds were not met
fuzzing.finding.new Fuzzer detected a new vulnerability or anomaly
contract.drift_detected Contract drift detected between recorded and live response
system.alert System-level incident (cleanup failure, license issue, resource exhaustion)

The full, always-current list comes from GET /api/v1/channels/preferences (the eventTypes field) — the UI renders the matrix from it, so new event types appear automatically.

Escalating unread notifications

If a bell notification stays unread for too long, Mockarty can escalate it to one of your connected messengers as a digest. Enable it in Settings → My Notification Channels → Escalation: pick the target channel and the threshold (how long a notification may stay unread before escalation). The feature is opt-in and off by default; enabling it requires at least one connected channel binding.

API: GET /api/v1/notifications/escalation / PUT /api/v1/notifications/escalation.

Messenger Bots — two-way commands

Telegram, Slack, VK Teams, Mattermost and Rocket.Chat channels are not just outgoing pipes: when the channel is configured for interaction, the bot also accepts commands — the same set on every messenger.

Connecting your account

A bot only acts on behalf of users it knows:

  • Telegram — connect from Settings → My Notification Channels (deeplink → press Start).
  • VK Teams — get a connect token in Settings → My Notification Channels and send the bot /start <token>.
  • Slack — request a one-time code via POST /api/v1/channels/slack/connect (or the Connect button in Settings), then send connect <code> to the bot in a DM.
  • Mattermost — get a connect token in Settings → My Notification Channels and send /mockarty link <token> in Mattermost.

An unknown user who writes to a bot gets onboarding instructions instead of a refusal.

Setting up the Mattermost bot

Mattermost drives the bot over a slash command (no bot needs to stay connected):

  1. In the Mockarty admin, add a Mattermost channel and fill Server URL + Slash Command Token (you’ll get the token from Mattermost in the next step).
  2. In Mattermost, Integrations → Slash Commands → Add a command with trigger word mockarty, Request URL https://<your-mockarty>/api/v1/messenger/webhook/mattermost/<channel-id>, method POST. Mattermost shows the command Token — paste it into the Mockarty channel’s Slash Command Token and save.
  3. Users type /mockarty <command> (e.g. /mockarty ask how do I mock gRPC). Command output is private to the sender; a meeting link is posted to the channel.

The Webhook URL field stays optional — set it if you also want outgoing notifications; the interactive bot works from Server URL + Slash Command Token alone.

Setting up the Rocket.Chat bot

Rocket.Chat drives the bot over an outgoing webhook (Rocket.Chat has no Mattermost-style slash-command integration):

  1. In the Mockarty admin, add a Rocket.Chat channel and fill Server URL + Outgoing Webhook Token (you’ll get the token from Rocket.Chat in the next step).
  2. In Rocket.Chat, Admin → Integrations → New → Outgoing with event Message Sent, trigger word mockarty, and URL https://<your-mockarty>/api/v1/messenger/rocketchat/outgoing/<channel-id>. Rocket.Chat shows a Token — paste it into the Mockarty channel’s Outgoing Webhook Token and save.
  3. Users type mockarty <command> (e.g. mockarty ask how do I mock gRPC). Because outgoing-webhook replies are public, command output posts into the room.
  4. Optionally add Bot Auth Token + Bot User ID (a Rocket.Chat personal-access-token for a bot user) to enable the membership guard and call-lifecycle relay via the REST API.

The Webhook URL field stays optional — set it if you also want outgoing notifications; the interactive bot works from Server URL + Outgoing Webhook Token alone.

Commands

Command What it does
/menu Quick actions as inline buttons (new meeting, tasks, status, help)
/meet Create a video-meeting link (Discussions meeting)
/tasks Your open tasks from the task tracker
/do <request> Hand a task to the Mockarty AI agent
/ask <question> Ask the knowledge base
/notifications Your recent notifications
/status Bot status
/help All commands

In group chats, address the bot as /command@BotName (Telegram) or by mentioning it (Slack @bot, VK Teams). Slack additionally supports slash commands via a configurable endpoint and always verifies request signatures with the channel’s Signing Secret. On Mattermost every command is a subcommand of the slash trigger — /mockarty ask …, /mockarty meet, /mockarty tasks, /mockarty link <token> — and each request is verified against the command’s token.

Voice messages (Telegram, VK Teams)

Send the bot a voice note (or an audio file / round video note) and it transcribes it with the Mockarty speech stack, then acts on the words:

  • In a private chat the transcript is treated as a task for the Mockarty AI agent — a hands-free /do. The bot replies with what it heard, hands the task to the agent under your account, and posts the agent’s answer back into the chat when it finishes. When speech synthesis is available on the deployment, the answer is also sent as a voice message (Telegram and VK Teams) — ask by voice, hear the reply. Requires your Telegram to be connected to a Mockarty account.
  • In a group chat the bot posts the transcript for everyone. If the group is linked to a discussion (/link), the transcript also joins the buffered history, so /summarize and /topics cover what was said out loud.

Voice notes up to 10 minutes are accepted. Transcription must be available on the deployment (a speech runner online or an external transcription API configured) — otherwise the bot says so honestly.

Linking a group chat to a discussion

A Telegram, VK Teams or Slack group can be linked to a Mockarty discussion: mint a token from the discussion panel (Sync → ), then send /link <token> in the group. From then on the bot keeps the recent history, /summarize posts a digest into the linked discussion, and /topics segments the buffered history into knowledge-base topics.

On Slack, linking additionally requires the app to subscribe to the message.channels event and be invited to the channel — that is how the bot sees the chatter it buffers for /summarize and /topics.

On Mattermost, the chat↔discussion link is /mockarty synclink <token> (distinct from /mockarty link, which binds your account), and buffering needs an outgoing webhook on the channel pointed at /api/v1/messenger/mattermost/outgoing/<Mockarty-channel-id> (use the same token as the slash command). Then /mockarty summarize and /mockarty topics work over the buffered history.

Group moderation

In groups the Telegram and VK Teams bots can guard membership with the full set /guard off | warn | grace | kick. Slack supports /guard off | warn | kick (a bound user sets it; the bot warns — or removes with the channels:manage scope + the member_joined_channel event — an unauthorized joiner); grace is available on Telegram and VK Teams. Mattermost supports /mockarty guard off | warn | kick too, but — because Mattermost gives the bot no join events — it enforces by a periodic membership poll and therefore needs an opt-in bot token (a bot account with manage_channel_members) set in the channel’s Bot Token field; without it guard stays off. Only a chat administrator can change the policy — except on Slack, where any member whose account is connected to Mockarty can, because Slack has no per-channel admin concept the bot can check. In grace mode a newcomer who is not connected to Mockarty gets a welcome message and a time window to connect before being removed; warn only warns, kick removes immediately, off disables guarding. Chat admins are always exempt — the guard never warns or removes an administrator (or the bot itself), so enabling kick will not touch the people who run the chat.

Telegram delivery mode: pull or webhook

By default the Telegram bot polls for updates (works without any inbound connectivity). For lower latency you can switch a channel to webhook mode — Mockarty registers a webhook with Telegram and receives updates on a public endpoint protected by an auto-generated secret:

POST /api/v1/admin/channels/:id/telegram/webhook
{"enabled": true}            # switch to webhook (rotateSecret: true to re-issue the secret)

The mode is also editable in the channel’s settings form (Mode: pull / webhook). Switching back and forth requires no restart.

AI Agent Integration

The AI agent (notifier sub-agent) can send notifications through system channels without credentials:

  1. list_system_channels — returns available channels with IDs
  2. send_via_channel — sends a notification through a channel by ID

Example agent interaction:

User: "Send a summary of today's test results to Slack"
Agent: [calls list_system_channels → finds Slack channel]
Agent: [calls send_via_channel with channel_id, title, text]

The agent can also use direct tools (send_slack, send_telegram, etc.) with explicit credentials if system channels are not configured.

Without AI Agent

The notification system works entirely without the AI agent:

  • Automatic notifications: Events (test completions, fuzzing findings, etc.) trigger notifications through the EventBus → Channel Dispatcher pipeline
  • User preferences: Control which events go where via the preferences matrix
  • Admin broadcasts: Admin can test channels directly from the admin panel

API Endpoints

Admin API

Method Endpoint Description
GET /api/v1/admin/channels List all channels
GET /api/v1/admin/channels/types List supported channel types
POST /api/v1/admin/channels Create a channel
PUT /api/v1/admin/channels/:id Update a channel
DELETE /api/v1/admin/channels/:id Delete a channel
POST /api/v1/admin/channels/:id/test Test a channel
GET /api/v1/admin/channel-delivery/dlq List dead-letter deliveries
GET /api/v1/admin/channel-delivery/retry-queue List deliveries waiting for retry
POST /api/v1/admin/channel-delivery/dlq/:id/requeue Re-queue a dead-letter entry
GET /api/v1/admin/channel-templates List channel message templates
POST /api/v1/admin/channel-templates Upsert a channel message template
DELETE /api/v1/admin/channel-templates/:id Delete a template override
POST /api/v1/admin/channel-templates/preview Render a template against a sample payload without persisting it
GET /api/v1/admin/channel-templates/snippets Catalog of reusable template snippets for the editor
GET /api/v1/notifications/catalog List registered event types (used by the UI router)

Delivery reliability

Every channel dispatch is logged to channel_delivery_log with a status that progresses through pending → delivered, or pending → retrying → dead_letter after exhausting max_retries. The admin UI under Notification Channels → Delivery Log gives you two views:

  • Dead Letter – deliveries that have used up all retries. You can requeue any entry with one click to send it back through the retry worker.
  • Retry Queue – deliveries currently waiting for their next retry attempt, sorted by next_retry_at.

A leader-only background worker picks up due retries, applies exponential backoff, and moves the row to dead_letter once retry_count >= max_retries.

Per-event message templates

The dispatcher renders every notification through an override-aware template engine. Lookup order is (most specific → least specific):

  1. (eventType, channelType, lang) – fully-specific override
  2. (eventType, channelType, "") – any language
  3. (eventType, "", lang) – any channel
  4. (eventType, "", "") – any channel, any language
  5. Built-in default shipped with the code

Templates use Go text/template syntax and have access to the raw event payload ({{ .Payload.fieldName }}), the resolved title ({{ .Title }}), body ({{ .Body }}), and deep link ({{ .Link }}).

Manage overrides from Notification Channels → Message Templates in the admin UI, or directly via the /api/v1/admin/channel-templates endpoints.

User API

Method Endpoint Description
GET /api/v1/channels List available channels
GET /api/v1/channels/bindings List my channel bindings
POST /api/v1/channels/bindings Connect to a channel
PUT /api/v1/channels/bindings/:id Update binding
DELETE /api/v1/channels/bindings/:id Disconnect
POST /api/v1/channels/telegram/connect Get Telegram deeplink
GET /api/v1/channels/preferences Get notification preferences
PUT /api/v1/channels/preferences Update a preference

See Also