🦞
Channel Integration

Connect OpenClaw to Mattermost

Integrate OpenClaw with your self-hosted Mattermost instance using the Bot API and WebSocket plugin.

🔷 Why Use Mattermost?
  • Self-Hosted — Full control over your data and infrastructure
  • Enterprise Ready — Built for team collaboration at scale
  • Open Source — Transparent, auditable codebase
  • WebSocket Support — Real-time messaging with low latency
  • Plugin System — Extend functionality with custom integrations

Setup Steps

1

Enable Bot Accounts in Mattermost

In your Mattermost System Console, enable bot account creation:

  • • Go to System Console → Integrations → Bot Accounts
  • • Enable "Enable Bot Account Creation"
  • • Save the settings
2

Create a Bot Account

Create a new bot account for OpenClaw:

  • • Go to Integrations → Bot Accounts → Add Bot Account
  • • Set a username (e.g., "openclaw")
  • • Set a display name and description
  • • Copy the generated Access Token (keep it secret!)
3

Get Your User ID

Find your Mattermost user ID for authorization:

  • • Click on your profile picture → Profile
  • • The User ID is shown in the profile modal
  • • Or use the API: GET /api/v4/users/me
4

Configure OpenClaw

Add the Mattermost configuration to your openclaw.json:

{
  "channels": {
    "mattermost": {
      "enabled": true,
      "serverUrl": "https://your-mattermost-server.com",
      "botToken": "YOUR_BOT_ACCESS_TOKEN",
      "allowFrom": ["YOUR_USER_ID"],
      "teamId": "YOUR_TEAM_ID"
    }
  }
}
5

Restart and Test

Restart OpenClaw and test the connection:

openclaw restart

Send a direct message to the bot in Mattermost to verify the connection.

Advanced Configuration
{
  "channels": {
    "mattermost": {
      "enabled": true,
      "serverUrl": "https://your-mattermost-server.com",
      "botToken": "YOUR_BOT_ACCESS_TOKEN",
      "allowFrom": ["USER_ID_1", "USER_ID_2"],
      "teamId": "YOUR_TEAM_ID",
      "allowChannels": ["CHANNEL_ID_1", "CHANNEL_ID_2"],
      "respondToMentions": true,
      "respondToDMs": true,
      "useWebSocket": true,
      "reconnectInterval": 5000
    }
  }
}
  • serverUrl — Your Mattermost server URL
  • teamId — The team ID to operate in
  • allowChannels — Restrict bot to specific channels
  • useWebSocket — Enable real-time WebSocket connection
  • reconnectInterval — WebSocket reconnect interval in ms
Features
  • Real-time WebSocket — Instant message delivery via WebSocket plugin
  • Channel & DM Support — Works in public channels and direct messages
  • File Attachments — Send and receive files through Mattermost
  • Threaded Replies — Keep conversations organized in threads
  • Markdown Support — Rich text formatting in responses
⚠️ Troubleshooting

Bot not responding?

Verify the bot token is correct and the bot has been added to the team and channels.

WebSocket connection failing?

Ensure your Mattermost server allows WebSocket connections and check firewall rules.

Permission errors?

Make sure the bot account has the necessary permissions in the System Console.

For more detailed configuration options and advanced features, visit the official documentation:

docs.openclaw.ai/channels/mattermost →

Mattermost Connected!

Add more channels or enhance your bot with custom skills.