Appearance
Mattermost Notifications
Scripts send Mattermost messages via the injected $notifications object, using named webhooks you configure in Admin Settings. The payload format is Slack-compatible, so any Mattermost incoming webhook works out of the box.
1. Create a Mattermost Incoming Webhook
- In Mattermost, go to Main Menu → Integrations → Incoming Webhooks(If you don't see Integrations, ask your admin to enable it under System Console → Integrations → Integration Management)
- Click Add Incoming Webhook
- Give it a display name (e.g. "ApiMeld") and optionally set a default channel
- Click Save and copy the webhook URL — it looks like:
https://mattermost.example.com/hooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Channel per environment
Consider separate webhooks for different channels — e.g. apimeld-prod for failures and apimeld-dev for dev runs. Each gets its own name in ApiMeld.
2. Add the webhook to ApiMeld
- Go to Admin → Settings → Notifications
- Under Mattermost Webhooks, click Add
- Enter a name (e.g.
"Ops Channel") and paste the webhook URL - Click Save
The name you enter here is what you pass as webhookName in your scripts.
Sending from a script
| Language | One-liner |
|---|---|
| PowerShell | $notifications.SendMattermost('Ops Channel', 'Task complete') |
| JavaScript / TypeScript | notifications.sendMattermost('Ops Channel', 'Task complete') |
| Python | notifications.send_mattermost('Ops Channel', 'Task complete') |
| Bash | notify_mattermost "Ops Channel" "Task complete" |
| C# | Notifications.SendMattermost("Ops Channel", "Task complete"); |
Larger example (Python)
python
import json
processed = 0
failed = 0
for record in records:
try:
process(record)
processed += 1
except Exception as e:
failed += 1
summary = f"Sync complete — {processed} processed, {failed} failed."
notifications.send_mattermost('Ops Channel', summary)Parameters
| Parameter | Description |
|---|---|
webhookName | The name of the webhook as saved in Admin → Settings → Notifications |
message | Plain text message to post |
Testing the webhook
After saving, click Test next to the webhook in Admin → Settings → Notifications to send a test message and confirm it's working.
Self-hosted Mattermost
Works with both Mattermost Cloud and self-hosted installations. Ensure your ApiMeld server can reach the Mattermost URL — if Mattermost is on an internal network, make sure the two services can communicate.