Reference · Tools

Mattermost

Manage channels, messages, reactions, and users on a Mattermost server, with file upload support.

Action (binary) Communication v1 Binary data

The Mattermost node posts messages — with file uploads when needed — and manages channels, reactions and users on a Mattermost server. A typical build is posting deployment notifications into a channel and reacting to the message once the smoke tests pass.

Node type
Action (binary)
Parameters
56
Outputs
Output, Error
Credentials
Mattermost API

Mattermost

Manage channels, messages, reactions, and users on Mattermost

Overview

The Mattermost tool interacts with a self-hosted Mattermost server via its REST API v4. It supports four resources: Channel (create, delete, addUser, members, restore, search, statistics), Message (post with optional file attachments and rich attachments, delete, postEphemeral), Reaction (create, delete, getAll), and User (create, deactivate, getAll, getByEmail, getById, invite). The message:post operation supports binary file uploads.

Category: Communication
Tool Name: mattermost
Version: 1

Appearance: Icon: si-mattermost | Color: #0058CC

Node Type

Action (Binary) — handles file/binary data operations

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Mattermost API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Channelchannel
Messagemessage
Reactionreaction
Useruser

Operations

OperationValueDescription
Add UseraddUserAdd a user to a channel
CreatecreateCreate a new channel
DeletedeleteSoft-delete a channel
MembersmembersGet members of a channel
RestorerestoreRestore a soft-deleted channel
SearchsearchSearch for channels in a team
StatisticsstatisticsGet statistics for a channel
DeletedeleteSoft-delete a post
PostpostPost a message into a channel
Post EphemeralpostEphemeralPost an ephemeral message visible to one user
CreatecreateAdd a reaction to a post
DeletedeleteRemove a reaction from a post
Get ManygetAllGet all reactions for a post
CreatecreateCreate a new user
DeactivatedeactivateDeactivate a user
Get By EmailgetByEmailGet a user by email
Get By IDgetByIdGet users by their IDs
Get ManygetAllGet many users
InviteinviteInvite users to a team by email

The operation list is scoped to the resource you pick, which is why create, delete and getAll each appear more than once.

Parameters

Channel: Add User

ParameterTypeRequiredDefaultDescription
Channel IDstringYesThe ID of the channel to add the user to. Supports expressions.
User IDstringYesThe ID of the user to add to the channel. Supports expressions like {{ $json.userId }}.

Channel: Create

ParameterTypeRequiredDefaultDescription
Team IDstringYesThe ID of the team to create the channel in. Find in Mattermost team settings. Supports expressions.
Display NamestringYesThe non-unique display name for the channel (e.g. “Announcements”). Supports expressions.
Channel NamestringYesThe unique URL-safe handle for the channel (e.g. “announcements”). Supports expressions.
TypeoptionsNopublicThe visibility of the channel.
Options: public, private

Channel: Delete

ParameterTypeRequiredDefaultDescription
Channel IDstringYesThe ID of the channel. Supports expressions.

Channel: Members

ParameterTypeRequiredDefaultDescription
Team IDstringYesThe ID of the team (used for channel filtering). Supports expressions.
Channel IDstringYesThe ID of the channel to get members for. Supports expressions.
Resolve DatabooleanNotrueWhether to resolve full user objects instead of just membership stubs.
Return AllbooleanNotrueWhether to return all results or only up to a given limit.
LimitnumberNo100Max number of results to return. Accepts 1–100. (shown when Return All is false)

Channel: Restore

ParameterTypeRequiredDefaultDescription
Channel IDstringYesThe ID of the channel. Supports expressions.
ParameterTypeRequiredDefaultDescription
Team IDstringYesThe ID of the team to search channels in. Supports expressions.
Search TermstringYesThe term to search for in channel names. Supports expressions.
Return AllbooleanNofalseWhether to return all results or only up to a given limit.
LimitnumberNo100Max number of results to return. Accepts 1–100. (shown when Return All is false)

Channel: Statistics

ParameterTypeRequiredDefaultDescription
Channel IDstringYesThe ID of the channel. Supports expressions.

Message: Delete

ParameterTypeRequiredDefaultDescription
Post IDstringYesThe ID of the post to delete. Supports expressions.

Message: Post

ParameterTypeRequiredDefaultDescription
Channel IDstringYesThe ID of the channel to post the message in. Supports expressions.
MessagestringNoThe message text to post. Supports expressions like {{ $json.text }}.
AttachmentsjsonNo[]Rich message attachments as a JSON array. Each attachment can have: fallback, color, pretext, text, author_name, author_link, author_icon, title, title_link, fields (array of {title, value, short}), image_url, thumb_url, footer, footer_icon, actions.
Other OptionscollectionNo{}Additional options for the post.
— Parent Post ID (Thread)stringNoIf set, the message will be a threaded reply to this parent post. Supports expressions.
Send Binary DatabooleanNofalseWhether to upload a binary file along with the message.
Binary PropertystringNodataName of the binary property on the input item to upload as a file attachment. Names are case-sensitive — see the upstream node’s Binary Data panel for the exact names to use. (shown when Send Binary Data is true)

Message: Post Ephemeral

ParameterTypeRequiredDefaultDescription
User IDstringYesThe ID of the user to send the ephemeral message to. Supports expressions.
Channel IDstringYesThe ID of the channel to send the ephemeral message in. Supports expressions.
MessagestringNoThe ephemeral message text. Supports expressions.

Reaction: Create

ParameterTypeRequiredDefaultDescription
User IDstringYesThe ID of the user adding the reaction. Supports expressions.
Post IDstringYesThe ID of the post to react to. Supports expressions.
Emoji NamestringYesThe emoji name without colons (e.g. “thumbsup”). Supports expressions.

Reaction: Delete

ParameterTypeRequiredDefaultDescription
User IDstringYesThe ID of the user whose reaction to remove. Supports expressions.
Post IDstringYesThe ID of the post. Supports expressions.
Emoji NamestringYesThe emoji name to remove (without colons). Supports expressions.

Reaction: Get Many

ParameterTypeRequiredDefaultDescription
Post IDstringYesThe ID of the post to get reactions for. Supports expressions.
Return AllbooleanNotrueWhether to return all reactions or limit the results.
LimitnumberNo100Max number of reactions to return. Accepts 1–100. (shown when Return All is false)

User: Create

ParameterTypeRequiredDefaultDescription
UsernamestringYesThe username for the new user. Supports expressions.
Auth ServiceoptionsNoemailThe authentication provider for the new user.
Options: email, gitlab, google, ldap, office365, saml
EmailstringNoThe email address for the new user (required when auth service is email). Supports expressions. (shown when Auth Service is email)
PasswordstringNoThe password for the new user (required when auth service is email). (shown when Auth Service is email)
Auth DatastringNoThe external auth data for the user (required when auth service is not email). (hidden when Auth Service is email)
Additional FieldscollectionNo{}Optional profile fields for the new user.
— First NamestringNoThe user’s given name.
— Last NamestringNoThe user’s family name.
— LocalestringNoThe user’s interface locale, e.g. en.
— NicknamestringNoThe user’s nickname.

User: Deactivate

ParameterTypeRequiredDefaultDescription
User IDstringYesThe ID of the user to deactivate. Supports expressions.

User: Get By Email

ParameterTypeRequiredDefaultDescription
EmailstringYesThe email address to look up. Supports expressions like {{ $json.email }}.

User: Get By ID

ParameterTypeRequiredDefaultDescription
User IDsstringYesComma-separated list of user IDs to look up. Supports expressions.
Additional FieldscollectionNo{}Optional filters for the lookup.
— SincestringNoOnly return users modified after this ISO datetime.

User: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNotrueWhether to return all users or only up to a given limit.
LimitnumberNo100Max number of users to return. Accepts 1–100. (shown when Return All is false)
Additional FieldscollectionNo{}Optional scoping and ordering for the listing.
— In TeamstringNoFilter users by team ID.
— Not In TeamstringNoExclude users in this team.
— In ChannelstringNoFilter users by channel ID.
— Not In ChannelstringNoExclude users in this channel.
— SortoptionsNousernameSort field. When sort is set, either “In Team” or “In Channel” must also be set.
Options: createdAt (Created At), lastActivityAt (Last Activity At), status, username

User: Invite

ParameterTypeRequiredDefaultDescription
Team IDstringYesThe ID of the team to invite users to. Supports expressions.
EmailsstringYesComma-separated list of email addresses to invite. Supports expressions.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

The Mattermost API response is merged into the item JSON at the top level, so the fields the input item already carried pass through unchanged and binary data is forwarded.

Operations that return a single object — every channel operation except Members and Search, both message posts, message delete, reaction create and delete, user create, deactivate, get by email and invite — produce one output item per input item.

Operations that return a list fan out: one output item per element, each a copy of the input item’s JSON with one record’s fields merged on. Those are:

OperationOne item per
channel / membersChannel member (a full user object when Resolve Data is on, otherwise a membership record)
channel / searchMatching channel
reaction / getAllReaction on the post
user / getByIdUser found
user / getAllUser in the listing

No Split Out node is needed after those five. Limit caps how many items come out; Return All pages through everything the server has.

File uploads. With Send Binary Data on, the named binary property is uploaded to Mattermost and attached to the post in the same execution — there is no separate upload node.

Usage Examples

  • Post a message to a Mattermost channel
  • Upload a file to a Mattermost channel with a message
  • Create a new Mattermost channel
  • Get all members of a channel
  • Add a reaction to a post
  • Invite users to a team by email
  • Search for channels in a team

Example Configuration

Create a public channel:

{
  "type": "mattermost",
  "parameters": {
    "resource": "channel",
    "operation": "create",
    "teamId": "team123",
    "displayName": "General Discussion",
    "channel": "general-discussion",
    "type": "public"
  }
}

Post a message with a file upload, as a threaded reply:

{
  "type": "mattermost",
  "parameters": {
    "resource": "message",
    "operation": "post",
    "channelId": "channel456",
    "message": "Here's the report you requested",
    "sendBinaryData": true,
    "binaryPropertyName": "attachment",
    "otherOptions": {
      "root_id": "{{ $json.parentPostId }}"
    }
  }
}

Create a user with email authentication:

{
  "type": "mattermost",
  "parameters": {
    "resource": "user",
    "operation": "create",
    "username": "john.doe",
    "authService": "email",
    "email": "john.doe@company.com",
    "password": "securepassword123",
    "additionalFields": {
      "first_name": "John",
      "last_name": "Doe",
      "nickname": "johndoe"
    }
  }
}

Create a user backed by LDAP instead:

{
  "type": "mattermost",
  "parameters": {
    "resource": "user",
    "operation": "create",
    "username": "jane.smith",
    "authService": "ldap",
    "authData": "jane.smith@ldap"
  }
}

Add a reaction to a post:

{
  "type": "mattermost",
  "parameters": {
    "resource": "reaction",
    "operation": "create",
    "userId": "user789",
    "postId": "post123",
    "emojiName": "thumbsup"
  }
}

Get channel members, capped at 50 and resolved to full user objects:

{
  "type": "mattermost",
  "parameters": {
    "resource": "channel",
    "operation": "members",
    "teamId": "team123",
    "channelId": "channel456",
    "resolveData": true,
    "returnAll": false,
    "limit": 50
  }
}

List every user in a team, sorted by username:

{
  "type": "mattermost",
  "parameters": {
    "resource": "user",
    "operation": "getAll",
    "returnAll": true,
    "additionalFields": {
      "inTeam": "team123",
      "sort": "username"
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Post messages (with file uploads), manage channels, reactions, and users on a Mattermost server.

Key Relationships

  • authService: "email" requires email and password parameters
  • authService other than “email” requires authData parameter
  • sendBinaryData: true requires binaryPropertyName parameter
  • returnAll: false enables the limit parameter
  • Collection parameters use flat object structure without _default wrapper

Key Notes

  • Channel Name is the URL handle, Display Name is the label. Channel Name must be unique and URL-safe; Display Name is what people see.
  • Sort needs a scope. In User: Get Many, setting Sort also requires In Team or In Channel in the same Additional Fields collection.
  • Delete is a soft delete for both channels and posts, and Channel: Restore brings a soft-deleted channel back.

Frequently asked questions

What is the difference between Channel Name and Display Name?

Channel Name is the URL handle and Display Name is the human-readable label. Creating a channel with a display name in the handle field produces a URL nobody expects.

What does user creation require?

It depends on the auth service: `email` requires email and password parameters, while any other auth service requires the authData parameter instead.

How do I attach a file to a message?

Turn on Send Binary Data, which then requires the binary property name holding the file.

When can I set a limit on list operations?

Only when Return All is off — that is what enables the limit parameter.

Build with the Mattermost node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Mattermost API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.