Skip to content

Mattermost Notifications

ApiMeld sends Mattermost notifications via Mattermost's Incoming Webhooks feature. The payload format is identical to Slack, so any channel that accepts an incoming webhook works out of the box.

1. Create a Mattermost Incoming Webhook

  1. In Mattermost, go to Main Menu → Integrations → Incoming Webhooks (If you don't see Integrations, ask your Mattermost admin to enable it under System Console → Integrations → Integration Management)
  2. Click Add Incoming Webhook
  3. Give it a display name (e.g. "ApiMeld") and optionally set a default channel
  4. Click Save and copy the webhook URL — it looks like:
    https://mattermost.example.com/hooks/xxxxxxxxxxxxxxxxxxxxxxxxxxxx

Channel per environment

Consider creating separate webhooks for different channels — e.g. apimeld-prod for production failures and apimeld-dev for development runs. Each gets its own named webhook in ApiMeld.

2. Add the webhook to ApiMeld

  1. Go to Admin → Settings → Notifications
  2. Under Mattermost Webhooks, click Add
  3. Enter a name (e.g. "Ops Channel", "Dev Alerts") and paste the webhook URL
  4. Click Save

3. Enable on a task

  1. Open a task and go to the Notifications tab
  2. Select the Mattermost webhook(s) to notify
  3. Choose the trigger events: On Success, On Failure, On Timeout
  4. Save the task

Message format

ApiMeld posts a plain text message to Mattermost containing:

  • Task name and run status (✅ Success / ❌ Failed / ⏱ Timed Out)
  • Start time and duration
  • Last few lines of output (truncated for long output)
  • A link to the full run log

Example notification

✅ ApiMeld — Task Succeeded
Task:     Nightly Order Sync
Status:   Success
Duration: 12.4s
Output:   Synced 1,247 orders. 3 skipped (already up to date).
[View full log →]

Sending from a script

Scripts can send Mattermost notifications mid-execution using the injected notifications object:

JavaScript / TypeScript:

js
notifications.sendMattermost('Ops Channel', 'Sync in progress: 500/1000 records processed')

PowerShell:

powershell
$notifications.SendMattermost('Ops Channel', 'Sync in progress: 500/1000 records processed')

Python:

python
notifications.send_mattermost('Ops Channel', 'Sync in progress: 500/1000 records processed')

C#:

csharp
Notifications.SendMattermost("Ops Channel", "Sync in progress: 500/1000 records processed");

Bash:

bash
notify_mattermost "Ops Channel" "Sync in progress: 500/1000 records processed"

Testing the webhook

After saving, click Test next to the webhook in Admin → Settings → Notifications to send a test message to the channel and confirm it's working.

Self-hosted Mattermost

ApiMeld works with both Mattermost Cloud and self-hosted installations. Make sure your ApiMeld server can reach the Mattermost URL — if Mattermost is on an internal network, ensure the two services can communicate.

ApiMeld Task Scheduler