Integration Overview
Incoming Webhooks
Send messages to Mattermost from external applications
Outgoing Webhooks
Trigger external services when messages match patterns
Slash Commands
Execute custom commands directly from the message input
OAuth 2.0 Apps
Build third-party applications with secure user authorization
Incoming Webhooks
Send messages to Mattermost channels from external applications without requiring a Mattermost user account.How Incoming Webhooks Work
- Create an incoming webhook in Mattermost
- Receive a unique webhook URL
- POST JSON payloads to the URL from your application
- Messages appear in the specified channel
Creating an Incoming Webhook
- Navigate to Integrations in the main menu
- Select Incoming Webhooks → Add Incoming Webhook
- Configure:
- Title: Descriptive name for the webhook
- Description: Purpose and usage notes
- Channel: Default destination channel
- Lock to channel: Force all posts to specified channel
- Username: Display name for webhook posts
- Icon: Custom avatar for the webhook
Sending Messages
POST a JSON payload to the webhook URL:Advanced Payload Options
Outgoing Webhooks
Trigger HTTP requests to external services when messages match specific criteria.How Outgoing Webhooks Work
- User posts message in Mattermost
- Message matches trigger word or channel
- Mattermost sends payload to configured callback URL(s)
- External service processes request
- Service can respond with message to post back
Creating an Outgoing Webhook
- Navigate to Integrations → Outgoing Webhooks
- Click Add Outgoing Webhook
- Configure:
- Title: Webhook name
- Description: Purpose documentation
- Content Type:
application/jsonorapplication/x-www-form-urlencoded - Channel: Specific channel or leave blank for all
- Trigger Words: Words that activate webhook (comma-separated)
- Trigger When: Start of message or anywhere in message
- Callback URLs: One or more URLs to call
Trigger Words
Exact Match (start of message):Outgoing Webhook Payload
Mattermost sends:Response Format
Respond with JSON to post a message:Outgoing webhooks only work in public channels. They must be enabled by system administrators in the configuration.
Slash Commands
Create custom commands that users can invoke directly from the message input box.Built-in Commands
Mattermost includes many built-in slash commands:Creating Custom Slash Commands
- Navigate to Integrations → Slash Commands
- Click Add Slash Command
- Configure:
- Title: Command name for management
- Description: What the command does
- Command Trigger Word: The command (e.g.,
deploy) - Request URL: Endpoint to receive command
- Request Method: POST or GET
- Response Username: Bot name for responses
- Response Icon: Bot avatar
- Autocomplete: Show in command autocomplete
- Autocomplete Hint: Usage hints (e.g.,
[environment]) - Autocomplete Description: Help text
Command Request
When user types/yourcommand arg1 arg2, Mattermost sends:
Command Response
Simple text response:ephemeral(default): Only visible to command userin_channel: Visible to everyone in channel
OAuth 2.0 Applications
Build third-party applications that integrate with Mattermost using OAuth 2.0 for secure authentication.Registering an OAuth App
- Navigate to Integrations → OAuth 2.0 Applications
- Click Add OAuth 2.0 Application
- Configure:
- Display Name: Application name
- Description: App purpose
- Homepage: Application website
- Callback URLs: Redirect URIs after authorization
- Icon URL: Application logo
OAuth 2.0 Flow
- Authorization Request:
- User Authorizes: User logs in and grants permissions
- Authorization Code: Redirect to callback with code
- Exchange for Access Token:
- Use Access Token:
Outgoing OAuth Connections
Securely connect outgoing webhooks and slash commands to OAuth-protected external services.Use Cases
- Webhooks to services requiring OAuth (GitHub, GitLab, etc.)
- Slash commands calling protected APIs
- Automatic token refresh
- Centralized credential management
Configuration
- System admin enables outgoing OAuth connections
- Configure OAuth connection with:
- Client ID and Secret
- Authorization and Token URLs
- Scopes required
- Audience/Resource URL patterns
- Webhooks/commands automatically use connection when calling matching URLs
Outgoing OAuth connections require system administrator configuration and are available in specific Mattermost editions.
Bot Accounts
Create dedicated bot accounts for integrations:- Cannot log in via UI (token-only access)
- Identified with BOT badge
- Don’t count against user licenses
- Perfect for webhooks and automation
- Can be assigned to specific integrations
Creating a Bot Account
- Navigate to Integrations → Bot Accounts
- Click Add Bot Account
-
Configure:
- Username: Bot username
- Display Name: Friendly name
- Description: Bot purpose
- Icon: Bot avatar
- Role: Bot permissions
- Receive access token for API calls
Interactive Messages
Create messages with buttons and menus that trigger actions:Message Menus
Add dropdown menus to messages:Dialog Boxes
Open interactive forms for complex user input:Integration Best Practices
Security
- Validate webhook tokens - Always verify incoming requests
- Use HTTPS - Encrypt data in transit
- Store secrets securely - Never commit tokens to version control
- Limit permissions - Use least privilege principle
- Rotate tokens regularly - Update integration credentials periodically
Performance
- Respond quickly - Webhooks timeout after 30 seconds
- Use async processing - Return 200 OK immediately, process later
- Implement retries - Handle temporary failures gracefully
- Rate limiting - Respect API rate limits
- Batch operations - Combine multiple updates when possible
User Experience
- Clear error messages - Help users understand what went wrong
- Consistent formatting - Use similar styles across integrations
- Helpful usernames - Make bot identity clear
- Rich attachments - Use colors and formatting effectively
- Ephemeral responses - Don’t spam channels with errors
Marketplace
Discover pre-built integrations in the Mattermost Marketplace:- GitHub - Repository notifications and actions
- GitLab - Merge requests and pipeline updates
- Jira - Issue tracking and updates
- Jenkins - Build notifications and triggers
- Zoom - Video meeting integration
- And 700+ more integrations