Connectors
Connectors are pre-built integrations that transform webhook payloads into native messages for popular platforms. Instead of writing custom delivery logic for each notification channel, create a connector and Mittr handles formatting, delivery, and retries.
Supported connectors
Section titled “Supported connectors”| Connector | Delivery method | Key features |
|---|---|---|
| Slack | Incoming webhook | Rich attachments, custom channel, username, emoji icons |
| Discord | Webhook | Embeds with color coding, custom bot username |
| Microsoft Teams | Incoming webhook | MessageCard format with theme colors and sections |
| SMTP | Templated subject and body, multiple recipients | |
| Webhook | HTTP POST | Generic passthrough to any URL |
Create a Slack connector
Section titled “Create a Slack connector”curl -X POST https://app.mittr.io/api/v1/connectors \ -H "X-API-Key: mtr_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "prod-slack-alerts", "type": "slack", "config": { "webhookUrl": "https://hooks.slack.com/services/T.../B.../xxx", "channel": "#webhook-alerts", "username": "Mittr", "iconEmoji": ":satellite:" } }'Create a Discord connector
Section titled “Create a Discord connector”curl -X POST https://app.mittr.io/api/v1/connectors \ -H "X-API-Key: mtr_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "prod-discord-alerts", "type": "discord", "config": { "webhookUrl": "https://discord.com/api/webhooks/123/abc", "username": "Mittr Bot" } }'Create a Teams connector
Section titled “Create a Teams connector”curl -X POST https://app.mittr.io/api/v1/connectors \ -H "X-API-Key: mtr_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "prod-teams-alerts", "type": "teams", "config": { "webhookUrl": "https://outlook.office.com/webhook/..." } }'Create an Email connector
Section titled “Create an Email connector”curl -X POST https://app.mittr.io/api/v1/connectors \ -H "X-API-Key: mtr_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "prod-email-alerts", "type": "email", "config": { "smtpHost": "smtp.gmail.com", "smtpPort": 587, "smtpUsername": "[email protected]", "smtpPassword": "app-password", "fromEmail": "[email protected]", "toEmails": ["[email protected]", "[email protected]"] } }'Message templates
Section titled “Message templates”Every connector supports customizable message templates using Go template syntax. Templates have access to the event type and full payload.
Template variables
Section titled “Template variables”| Variable | Description |
|---|---|
{{.event_type}} | The event type (e.g., order.created) |
{{.payload}} | The full event payload as a map |
{{.message}} | Shorthand for payload.message if present |
| Any payload field | Top-level payload fields are merged into the template context |
Custom template example
Section titled “Custom template example”curl -X POST https://app.mittr.io/api/v1/connectors \ -H "X-API-Key: mtr_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "order-slack", "type": "slack", "config": { "webhookUrl": "https://hooks.slack.com/services/T.../B.../xxx", "channel": "#orders" }, "template": { "text": "New {{.event_type}} from {{.customer_name}}", "title": "Order #{{.order_id}}", "color": "#36a64f" } }'Default templates
Section titled “Default templates”If no custom template is provided, Mittr uses sensible defaults:
- Slack:
{{.event_type}}: {{.message}}with green attachment - Discord: Same text format with info-colored embed
- Teams: MessageCard with event type as title
- Email: Subject
[Mittr] {{.event_type}}, body lists all payload fields
Payload transformation
Section titled “Payload transformation”Connectors automatically transform your event payload into the native format for each platform:
- Slack: JSON with
text,channel,username,icon_emoji, andattachments - Discord: JSON with
content,username, andembeds - Teams: MessageCard schema with
@type,themeColor, andsections - Email: Renders subject and body from templates, delivers via SMTP
- Webhook: Passes the payload through as-is (no transformation)
Manage connectors
Section titled “Manage connectors”# List all connectorscurl https://app.mittr.io/api/v1/connectors \ -H "X-API-Key: mtr_your_key"
# Get a specific connectorcurl https://app.mittr.io/api/v1/connectors/prod-slack-alerts \ -H "X-API-Key: mtr_your_key"
# Update a connectorcurl -X PUT https://app.mittr.io/api/v1/connectors/prod-slack-alerts \ -H "X-API-Key: mtr_your_key" \ -H "Content-Type: application/json" \ -d '{ "config": { "channel": "#critical-alerts" }, "template": { "color": "#ff0000" } }'
# Delete a connectorcurl -X DELETE https://app.mittr.io/api/v1/connectors/prod-slack-alerts \ -H "X-API-Key: mtr_your_key"Use with alert rules
Section titled “Use with alert rules”Connectors are most powerful when paired with alert rules. Create an alert rule that triggers a connector when delivery failures exceed a threshold:
# Create alert rule that notifies Slack on failurescurl -X POST https://app.mittr.io/api/v1/alert-rules \ -H "X-API-Key: mtr_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "failure-spike", "condition": "failure_rate > 10%", "connectorName": "prod-slack-alerts" }'