Build your first agent in just a few minutes with [Rasa Copilot](https://hello.rasa.com/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta).

## Getting Credentials

Mattermost now uses bot accounts for better security. So you can use their guide to create your bot to get your token required for the credentials.yml file.

For more information on creating a bot account please see [Bot Creation](https://docs.mattermost.com/developer/bot-accounts.html#bot-account-creation).

For information on converting existing user account into bot account please see [User Conversion](https://docs.mattermost.com/developer/bot-accounts.html#how-do-i-convert-an-existing-account-to-a-bot-account).

**How to set up the outgoing webhook:**

1. To create the Mattermost outgoing webhook, login to your Mattermost team site and go to **Main Menu > Integrations > Outgoing Webhooks**.
2. Click **Add outgoing webhook**.
3. Fill out the details including the channel you want the bot in. You will need to ensure the **trigger words** section is set up with `@yourbotname` so that the bot doesn't trigger on everything that is said.
4. The **Content Type** must be set to `application/json`.
5. Make sure **trigger when** is set to value **first word matches a trigger word exactly**.
6. Add the Callback URL, which will look like `http://<host>:<port>/webhooks/mattermost/webhook`, replacing the host and port with the appropriate values from your running Rasa server.

For more detailed steps, visit the [Mattermost docs](https://docs.mattermost.com/guides/developer.html).

## Running on Mattermost

Add the Mattermost credentials to your `credentials.yml`:

```yaml
mattermost:
  url: "https://chat.example.com/api/v4"
  token: "xxxxx" #  the token for the bot account from creating the bot step.
  webhook_url: "https://server.example.com/webhooks/mattermost/webhook"  # this should match the callback url from step 6
```

Restart your Rasa server to make the new channel endpoint available for Mattermost to send messages to.

- [Getting Credentials](/content/docs/reference/channels/mattermost/#getting-credentials/index.html)
- [Running on Mattermost](/content/docs/reference/channels/mattermost/#running-on-mattermost/index.html)
