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, agent task completions, and system events directly in their preferred messenger.
Architecture
The notification system uses a two-level model:
- Admin configures system-wide notification channels (e.g., “Corporate Slack”, “Telegram Bot”)
- 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.
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 |
| 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
- Go to Admin Panel → Notification Channels
- Click Add Channel
- Select the channel type
- Fill in the configuration (follow the setup hints shown for each type)
- (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.
- Click Save
- 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
- Open Telegram, find @BotFather
- Send
/newbot, follow the prompts to create a bot - Copy the bot token (format:
123456789:ABCdef...) - In Mockarty Admin → Channels → Add → Telegram:
- Bot Token: paste the token
- Bot Username:
@YourBotName(optional, for display)
- Save and enable
Users will connect by clicking a deeplink that opens the bot in Telegram.
Slack
Option A: Bot Token (recommended for DMs)
- Go to api.slack.com/apps → Create New App
- Add Bot Token Scopes:
chat:write,users:read.email - Install to workspace, copy the Bot Token (
xoxb-...) - In Mockarty: paste as Bot Token
Users enter their Slack email to receive DMs.
Option B: Incoming Webhook (channel-level)
- In Slack App → Incoming Webhooks → Add New Webhook
- Select a channel, copy the URL
- In Mockarty: paste as Webhook URL
Discord
- In Discord: Server Settings → Integrations → Webhooks → New Webhook
- Select a channel, copy the webhook URL
- In Mockarty: paste as Webhook URL
No per-user binding needed — messages go to the channel.
Microsoft Teams
- In Teams channel: click
...→ Workflows - Select “Post to a channel when a webhook request is received”
- Follow the setup wizard, copy the webhook URL
- In Mockarty: paste as Webhook URL
Note: Legacy Office 365 Connector URLs are being retired. Use Workflows (Power Automate) webhooks.
PagerDuty
- In PagerDuty: Services → select service → Integrations tab
- Add Integration → Events API v2
- Copy the Integration Key
- In Mockarty: paste as Integration Key (
routing_key) - Optional: set Severity — one of
critical,error,warning,info(defaults are applied per event type if omitted)
OpsGenie
- In OpsGenie: Teams → select team → Integrations → Add integration → API
- Copy the API Key
- In Mockarty: paste as API Key
- Select Region —
us(api.opsgenie.com) oreu(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
- Go to Settings → My Notification Channels
- Available channels configured by admin are listed under Available Channels
- Click Connect on the desired channel
Telegram Connection
- Click Connect on the Telegram channel
- A deeplink opens – click it to go to the bot in Telegram
- Press Start in the bot chat
- Connection is confirmed automatically
Slack Connection
- Click Connect on the Slack channel
- Enter your Slack workspace email
- 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:
| Event ID | Description |
|---|---|
agent.task.completed |
AI agent finished a task successfully |
agent.task.failed |
AI agent task encountered an error |
test.run.completed |
API test collection run finished |
test.run.failed |
API test collection run failed |
perf.test.completed |
Performance / load test finished |
perf.test.threshold_breach |
Performance test breached an SLO threshold (latency, error rate, throughput) |
fuzzing.finding.new |
Fuzzer detected a new vulnerability or anomaly |
contract.drift.detected |
Contract drift detected between recorded and live response |
system.incident.triggered |
System-level incident (cleanup failure, license issue, resource exhaustion) |
Use checkboxes in the preferences matrix to enable/disable each event per channel. Event IDs above are the canonical identifiers emitted on the EventBus and used by the template engine.
AI Agent Integration
The AI agent (notifier sub-agent) can send notifications through system channels without credentials:
list_system_channels— returns available channels with IDssend_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):
(eventType, channelType, lang)– fully-specific override(eventType, channelType, "")– any language(eventType, "", lang)– any channel(eventType, "", "")– any channel, any language- 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
- Webhooks & Callbacks – Mock-level webhooks for HTTP, Kafka, and RabbitMQ callbacks
- Integrations Guide – Integration tokens, resolver nodes, runner agents, and CI/CD
- Administration Guide – User management, namespaces, and system configuration
- API Reference – Full REST API documentation