# Mattermost

EvoHub can post On-Call alerts to a Mattermost channel, on Mattermost Cloud or your own server. Each alert arrives as a message with its title, severity, status, source and start time, and links to acknowledge it, resolve it or open it in EvoHub. Mattermost runs alongside paging: it never replaces the phone calls, push notifications and emails your escalation policies send.

Mattermost messages are free: they are not counted towards your usage.

## Add a Mattermost channel

:::steps
### Create an incoming webhook in Mattermost
In Mattermost, open **Integrations → Incoming Webhooks → Add Incoming Webhook**, choose the channel, and save. Copy the URL Mattermost shows you; it looks like `https://mattermost.example.com/hooks/<id>`. If **Integrations** is missing, a system admin must enable incoming webhooks.
### Add the channel in EvoHub
In EvoHub go to **On-Call → Chat Channels**, click **Add channel** and choose **Mattermost**. Give it a name, paste the URL, and choose whether **every new alert** should be posted there.
### Check it works
Click **Add and send a test**. A message saying "EvoHub is connected" appears in the channel. You can send another test at any time with **Send test**.
:::

The URL is a credential: anyone who has it can post to your channel. EvoHub stores it encrypted and never shows it again.

EvoHub only posts to a Mattermost server on a public host name over `https`. An IP address, a name without a domain (such as `mattermost`), or a name that resolves to a private address is refused — a Mattermost server reachable only inside your network cannot receive EvoHub's posts.

Adding, testing and removing chat channels needs the On-Call settings permission.

## Where alerts are posted

- **Every new alert** — tick **Every new alert** on the channel in **Chat Channels**.
- **From an escalation step** — open the escalation policy, click **Edit**, and in the step's **Chat** area pick the channel. The step still pages its target; the post is in addition. See [Escalation policies](https://docs-dev.evohub.io/escalation-policies.md).

An alert is posted to a channel once, even if both apply.

## Acknowledge and resolve from Mattermost

The **Acknowledge** and **Resolve** links open EvoHub in your browser. You confirm the action there, signed in as yourself:

- You need permission to respond to alerts. If the alert belongs to a team, you must be in that team, be an admin, or be the person the alert is assigned to.
- Each link works once and expires after 24 hours. After that, use **Open in EvoHub** instead.

The action is recorded on the alert's timeline under your name, for example "Acknowledged from Mattermost."

EvoHub does not use Mattermost's interactive buttons: Mattermost does not sign the request a button sends, so the person it names could not be trusted to be the one who clicked.

## When the alert changes

An incoming webhook cannot edit a message it has posted. So when the alert is acknowledged, taken over or resolved — anywhere: in EvoHub, the mobile app, by phone or in another chat — EvoHub posts a short follow-up message, for example "**Resolved by Ada Lovelace**: Disk full on db-1".

Text from the alert is shown as plain text: links, `@channel` and `@all` in an alert's title or description do not become links or mentions.

## Remove a channel

In **On-Call → Chat Channels**, click the bin icon next to the channel and confirm. Escalation steps that named it post nowhere until you choose another channel. Delete the incoming webhook in Mattermost as well if you no longer need it.

## Related

- [Google Chat](https://docs-dev.evohub.io/google-chat.md)
- [Slack](https://docs-dev.evohub.io/slack.md)
- [Escalation policies](https://docs-dev.evohub.io/escalation-policies.md)
