Mattermost bot accounts and personal access tokens

Mattermost bot accounts give integrations their own identity and token-based API access, so automation keeps working when a staff member leaves. This page covers how to set them up, what they can post and where, and what they cost under your license.

On this page

Why Mattermost bot accounts and personal access tokens matter for integrations

An integration that runs under a person's login stops working the day that person leaves. The fix is to give the integration its own identity. In Mattermost, that means a bot account for work that posts or reads on behalf of a service, or a personal access token for scripts that call the API. A bot account is a non-human user that your organization creates and owns, so its messages and permissions do not depend on any one employee. A personal access token is a credential issued to an existing user account, so it carries that user's identity and permissions. Teams often start with a script that uses an engineer's own token, and that shortcut is what breaks during offboarding. Before the first production integration goes live, list every webhook, script and bot in your environment and record which person's account each one depends on.

Use a bot account when the integration posts messages, reads channels or needs a stable name and membership that others can see, such as an alerting service or a deployment notifier. Use a personal access token when a script must act as a specific user and a separate identity is not justified, and keep those tokens on a short list you can review. Both options require someone with the right system role to create them. Confirm in the current Mattermost documentation which roles can create bot accounts and personal access tokens, whether tokens can be restricted or set to expire, and what happens to a token when its owner is deactivated. Those answers determine your offboarding procedure, so test them on a staging server before you write the runbook.

Two points need checking in your own environment before you rely on them. First, confirm that a bot can post in the private channels and direct messages it needs, because membership and visibility rules determine what the integration can see and where its messages appear. Second, ask Mattermost how bot accounts and tokens are treated under your subscription. Plans are sold as seat-based annual subscriptions, and the Mattermost pricing page lists no public prices, so the licensing treatment belongs in your written quote. Record each bot's owner, purpose and channel membership in your inventory so that a later administrator can see the intent without reconstructing the setup.

Choosing between a bot account, a personal access token and a personal account

A bot account is a non-human user that Mattermost creates for an integration, with its own username, profile and access token. It is the option most teams choose for a service that posts alerts, runs slash commands or syncs provisioning data, because the identity belongs to the service rather than to a person. Ownership should sit with a named team, and the bot's access should be limited to what the integration needs.

  • Ownership: Record a responsible team and a service owner in your register, and write a bot description that tells administrators what the integration does.
  • Offboarding: Staff changes do not change the bot's identity, but confirm in your version how bot ownership is reassigned and what happens when the creating user is deactivated. Test that path before the first departure.
  • Private channels and DMs: The bot can post only where it has been added as a member. Add it deliberately to each private channel it needs and keep that list in the change record.
  • Audit records: Bot posts and API actions carry the bot's username, which separates integration activity from staff activity. Confirm how the audit log labels bot actions in your version.
  • Credentials: Store the bot's token in a secrets manager, assign a rotation owner, and set a rotation schedule.

Check who owns the bot, what happens to it when its creator leaves, and which private channels it has been added to.

How an integration authenticates and posts as a bot

The flow starts with an administrator creating the bot account and issuing it a token, which is then stored on the integration host. The integration sends REST API requests with that token as a bearer credential across the trust boundary to the Mattermost server. The server checks that the bot is a member of the target team and channel before it records the post under the bot's own user. Check the membership step first when a post fails, and check where the token is stored on the integration host.

Bot token flow from the integration host into the Mattermost server.

Configuration options for bots and tokens and when each fits

This table compares the main System Console settings that control who can create Mattermost personal access tokens and bot accounts, how far each bot reaches, and how access ends. Read each row as a decision to make before rollout. The main takeaway is that bots suit shared integrations better than tokens tied to one person, provided each bot has a named owner and a narrow membership list.

SettingWhen to use itTrade-off
Enable personal access tokensA named administrator needs API access for scripts and no shared integration exists yetToken actions run with the user's permissions and stop working when that user is deactivated
Who may create tokensRestrict creation to a small admin group for production automationBroader creation spreads credentials across staff, which makes inventory and revocation harder
Enable bot account creationShared integrations, such as CI jobs, alert feeds or provisioning scripts, need their own identityMore accounts to inventory and review, and each one needs an accountable owner
Bot team and channel membershipScope each bot to the teams and channels its integration needsA bot only posts where it is a member, so missing memberships cause silent integration failures
Bot ownerRecord an accountable person or team for every bot at creationOwnership is an administrative record, so the owner must be reassigned when they leave
Bot deactivationRetire an integration by disabling its bot, which keeps its history for auditConfirm with your version whether disabling also revokes the bot's tokens and how to reactivate it

How to set up a bot account and token in Mattermost

This sequence takes a self-hosted Mattermost server from a version and plan check to a bot account that owns its own API token, can read and post in the channels it needs, and keeps working after the staff member who requested it leaves. Each step ends with a check so you know it worked before moving on.

  1. Confirm server version, plan and integration settings

    Before anything else, confirm which Mattermost server version and plan your deployment runs, using the server administrator's console and the release information for your build. Then open the integrations settings in the System Console and check that bot accounts, personal access tokens and the relevant integration options are enabled by your administrator. Confirm the release you run is still supported according to the server releases page, since a server out of support is a poor place to anchor a new integration. Done means you have written down the version, the plan level and the exact settings your administrator confirmed.

  2. Enable bot accounts and token creation

    In the System Console, locate the bot account and personal access token options under the integrations section and turn on the settings your design requires. Decide whether members other than system administrators may create tokens, because that choice determines who can issue credentials later. Record the setting values in your change ticket so an auditor can see when token creation was opened and by whom. Done means a test user with the intended role can see the option, and a user without it cannot.

  3. Create the bot with a clear name and owner

    Create the bot from the Integrations section, giving it a name that states its purpose, such as a service name and environment, rather than a person's name. Set a description and assign an owning team or named service owner who answers for the bot's access and token rotation. Avoid reusing a bot for unrelated integrations, because one credential then carries every permission. Done means the bot appears in the bot list with its name, description and owner recorded, and the bot user is visible in the directory.

  4. Add the bot to teams and channels it needs

    Add the bot only to the teams and channels its job requires, following the access model you agreed with the channel owners. For private channels and direct messages, confirm that a bot can only post where it has been added as a member, so you do not assume it can reach conversations beyond its membership. Check the channel's member list after adding the bot and confirm its role is what you intended. Done means the member list of each target channel shows the bot, and no unintended channel lists it.

  5. Issue a token and store it in a secrets manager

    Generate a personal access token for the bot account from the bot's management page and copy it once, because the value is shown only at creation. Store the token immediately in your organization's secrets manager, with access limited to the service that needs it, and never place it in chat, tickets, source repositories or shared documents. Record the token's identifier, creation date and the secret's location in your credential inventory, and plan a rotation owner. Done means the secret exists in the vault under the agreed path and the token identifier appears in your inventory.

  6. Test a read with the token

    From the system that will hold the token, make a single authenticated read request to the Mattermost API, such as retrieving the bot's own user record or a channel the bot belongs to, using the token from the secrets manager rather than pasting it into a command history. Confirm the response identifies the bot account, not a person, and that the channel data returned matches the membership you set. Run the same request with a deliberately wrong token and confirm it is refused. Done means the authenticated read succeeds, the unauthenticated or invalid request fails, and the results are noted in your runbook.

  7. Test a post and confirm the bot appears as the author

    Send one test message to a channel the bot has joined, using the stored token, and confirm it appears in the channel with the bot's name as author. Then attempt a post to a channel the bot is not a member of and confirm the server refuses it, which proves the membership boundary holds. Remove the test message once verified, and record the test date and outcome in the integration's runbook. Done means the permitted post appears under the bot's name, the forbidden post is rejected, and the runbook records both results, so the bot is ready for handover to its owner.

Posting rights in private channels and direct messages

A bot account can only read and post where it is a member, so channel membership is the access control. A bot added to a public channel can post there, but private channels and direct messages do not behave that way. Nothing in a team-wide or system-level setting opens them up automatically, so each private channel the integration must reach needs the bot added explicitly. Direct messages are different again: a bot cannot be invited into an existing one-to-one conversation the way it joins a channel, so any flow that needs to post privately to a person has to be designed around the bot's own direct channel with that user, and tested as such. Confirm the exact behavior for your server version in a test workspace before you rely on it.

The risk is over-broad membership. It is tempting to add a bot to every private channel so it never fails, but that gives a single token read access to conversations nobody reviewed. If the token leaks, or the integration is compromised, the attacker inherits everything the bot can see. Start from the narrowest set of channels the workflow needs, and record the reason each one is included. Keep the bot out of private channels that are only used for HR, legal, incident response or executive matters unless a named owner has approved it. Review membership when a project or channel is archived, because a bot left in a closed channel still holds access.

Before rollout, test in a non-production workspace that mirrors your channel types. Confirm that the bot can post in a channel it has joined, that it receives nothing from channels it has not joined, and that removing it from a private channel stops both posting and reads. Check that a message to a user reaches the expected direct channel and nothing else. Verify how the bot appears in member lists and audit records, so reviewers can tell its actions from a person's. Finally, ask the administrators who run your deployment to confirm which roles can add bots to private channels on your server version, and document who approves each addition.

Security and operational considerations for bot tokens

Bot accounts and personal access tokens give integrations standing access to your Mattermost server, so the controls around them matter as much as the setup. The cards below cover the practices that keep those credentials contained, traceable and current after the original builder has moved on.

Store and rotate tokens deliberately

Keep each bot token in the secrets manager or encrypted configuration of the service that uses it, never in a chat message, a ticket or a shared repository. Give every integration its own token so that one rotation does not break unrelated bots. Record who holds each token, when it was created and which bot it belongs to, and set a rotation date that someone owns. Check that rotation replaces the token in every consuming service, because an old token left in one place will keep working until you revoke it.

Mattermost SSO docs

Grant least-privilege team and channel membership

A bot only needs to join the teams and channels its integration serves. Add it to those channels explicitly rather than giving it system-wide reach, and review its team memberships when the integration's scope changes. Confirm whether the bot's role grants administrative rights, and downgrade it if the integration only posts messages. Private channels and direct messages need the same scrutiny, because a bot added there can read content that the original builder never intended it to see.

Revoke tokens immediately after a leak

If a token appears in a log, a screenshot, a pasted snippet or a repository, revoke it first and investigate second. Revoking stops the exposed credential at once, and the replacement token can be issued to the owning service afterward. Check the server's audit records for activity from that bot during the exposure window, then review which channels it could read and post to. Ask whether the integration host's logs also captured the token, since copies often persist outside Mattermost.

Audit which account posted each message

Messages from a bot show the bot's name, which hides the human or service that triggered them unless your integration adds that context. Require every integration to include the originating system and requester in message text or metadata. Confirm that your audit and logging configuration captures bot and API activity, and test it by posting a message and tracing it back to the token that sent it. Review those records on a schedule, not only after an incident.

Include bots in offboarding

Bot accounts often outlive the staff member who created them, so offboarding must cover them as a separate step. Build an inventory of every bot, its owner, the tokens it holds and the services that depend on it. When the owner leaves, assign a new owner or disable the bot, then rotate its tokens. Confirm that deactivating a user does not silently leave a bot working, and document who approves that change.

Patch the hosts that run integrations

Every webhook receiver, scheduled script or middleware service that holds a bot token is an attack path into Mattermost, so it belongs in your patching cycle. Track operating system and runtime updates for those hosts alongside the Mattermost server itself. Restrict network access so each host can reach only the Mattermost endpoints it needs. Confirm the Mattermost server version you run is supported by checking the release schedule before planning maintenance windows.

v12.0 support end
2027-01-15
Server release schedule

How licensing and cost treatment affect the bot decision

The first cost question for a bot account is whether it consumes a paid seat. Mattermost sells Professional, Enterprise and Enterprise Advanced plans as prepaid annual subscriptions based on the number of seat licenses, and its pricing page lists no public prices and directs buyers to contact sales. Do not assume a bot is free or that it counts as a full user. Ask the vendor in writing how bot accounts are counted at your plan level, whether deactivated bots release a seat, and whether the answer changes if the bot is added to many channels. Also confirm which features your plan includes, since the pricing page ties SSO and AD/LDAP sync to the Professional plan and high availability to Enterprise, so a bot-heavy design may push you toward a higher tier for other reasons.

An in-house build pays your own engineers to design the bot identity model, create and scope tokens, write the integration code, and set up logging and alerting. A partner build adds a fixed-scope fee for the same work plus documentation handover. Both options carry recurring cost that is easy to underestimate: rotating tokens on a schedule, reviewing which bots still have channel memberships and permissions, reviewing integrations after each server upgrade, and retesting when a new monthly server release arrives. Ask any partner to split the quote into one-time build work and recurring work, and to name who performs each recurring task. Quotes that fold everything into a single figure make it hard to compare with an internal estimate or to know what a retainer would cover later.

Before accepting any quote, request a written scope that lists the bot accounts to be created, the permissions each needs, the token lifecycle and rotation process, the channels and direct messages the bots will access, the integrations and their owners, the upgrade and retest steps tied to Mattermost release dates, and the handover of credentials and runbooks to your team. Ask for the licensing treatment confirmed by the vendor, not by the partner alone, and for the assumptions behind each line item. Also ask what changes in cost if you add bots, move to high availability or change plans. A clear written scope lets you compare the build with your own team on equal terms, and it defines what you will still pay for after the first deployment.

Common questions about Mattermost bots and tokens

How much effort does setting up Mattermost bot accounts take?

Effort depends mainly on how many integrations you move off personal accounts and how many channels and direct message paths each one needs. Creating a single bot is quick. The larger work is the design around it: naming conventions, an owner for each bot, least-privilege channel membership, a secret store for tokens, logging, and a test run in a non-production server. DeployOpen plans this work as a fixed scope agreed in writing before work starts, so the quote follows from the integrations and environments you list. Ask any provider to price each integration separately so you can see which ones drive the cost.

Can an internal admin set up Mattermost bots without outside help?

Yes, a system administrator with API experience can create bot accounts and tokens and wire up a single integration on their own. The harder part is the governance: deciding who may request a bot, which teams and channels it can reach, how tokens are stored and rotated, and how the bot is documented for the next person. Teams that run several integrations often find these decisions take longer than the technical steps. DeployOpen can take on the design and build for a defined scope, or support your admin on specific pieces, and your internal team keeps ownership of the running system.

What does our team need to provide before bot work starts?

The work goes faster when your team supplies a clear starting inventory. Typically that includes:

  • A list of every integration that currently posts or reads through a personal account, with its owner and the systems it calls.
  • The channels, private channels and direct message flows each integration must reach.
  • Admin access to the self-hosted server, a non-production instance for testing, and the approved secret storage platform.
  • Your identity setup, including whether SSO or AD/LDAP sync is in place, since the Mattermost pricing page places these features in the Professional plan and above.
  • A named approver for bot creation and a security contact for token policy.
What happens to Mattermost bots when a staff member leaves?

A bot account is a separate identity, so it does not stop working when the employee who set it up leaves. That is the main reason to use bots for integrations. The risk shifts to ownership: if no one is recorded as responsible, nobody notices when a bot needs a new token or a permission change. Personal access tokens are different, because they belong to a user account, so their behavior when that user is deactivated needs to be tested in your environment. Confirm how deprovisioning in your SSO or AD/LDAP setup treats user accounts, tokens and bot ownership, and record an owner for every bot.

Do Mattermost bot accounts require a paid plan?

Mattermost sells Professional, Enterprise and Enterprise Advanced plans as prepaid annual subscriptions based on seat licenses, and its pricing page lists no public prices. The supplied facts do not state whether bot accounts consume a seat license, so do not assume either way. Ask Mattermost sales to confirm in writing how bot accounts are counted under your intended plan, and whether any features your integrations rely on, such as SSO or AD/LDAP sync, require a specific plan. Check the Mattermost pricing page for the current plan list before you request a quote.

How should Mattermost personal access tokens be rotated?

Set the rotation schedule in your security policy, because no vendor-wide interval applies to every organization. The procedure matters more than the interval. Create a new token for the bot, store it in your secret manager, deploy it to the integration, confirm the integration works, then revoke the old token. Rotate immediately when a bot owner changes, when a token may have leaked, or when an integration is retired. Confirm in the administration documentation for your server version which token settings and expiry options are available, and test the procedure in a non-production instance first.

Do Mattermost upgrades break bot and token integrations?

They can, which is why upgrades need a test step for every integration. Mattermost releases a new server version in binary form on the 16th of each month. Extended Support Releases follow a longer cycle: v11.7 is an ESR released on 2026-05-15 with support ending 2027-05-15, and v10.11 reached end of life on 2026-08-15. Non-ESR versions have shorter support windows, so check the Mattermost server releases page for current dates. Before each upgrade, run every bot and integration against a staging server on the target version and review the release notes for API changes.

What a DeployOpen bot and token engagement covers

A DeployOpen bot and token engagement is a fixed-scope written agreement that covers four workstreams: a bot inventory, membership design, token handling, and testing with handover. The inventory lists every integration that currently posts or reads through a personal account, along with the service, the owning team, the teams and channels it touches, and the permissions it needs. Membership design then decides which bot accounts join which teams, channels and direct message routes, and which bots should be read-only. Token handling covers who may create personal access tokens, how they are stored and rotated, and how they are revoked when an owner changes roles. Scope, deliverables and timelines are agreed in writing before work starts, so the inventory and membership decisions can be reviewed by your security and collaboration owners first.

Testing and handover close the engagement. Testing checks that each bot can post in the channels it was meant to reach, cannot reach channels outside its design, and that disabling or deactivating a staff member does not break a service integration. Handover delivers the inventory, the membership map, the token procedure and the test results to your team, so your administrators can run the process without the engagement team. Confirm with your administrators which system settings control bot creation, token creation and personal access token access in your server version, because those settings differ between releases and plan levels. The exact list of controls in scope should be confirmed in the written scope, not assumed from this page.

Optional retainer support covers work that recurs after handover, such as reviewing new integrations before they receive a bot account, rotating tokens on a schedule your policy sets, and rechecking membership after reorganizations. Ask for the retainer terms in writing, including what is reviewed, how requests are logged and who is responsible for token storage. Your quote should separate the one-time inventory, design and testing work from any recurring retainer, so you can see what you pay once and what you pay each period.

How DeployOpen scopes, delivers and supports Mattermost integrations

DeployOpen plans, builds, tests and hands over bot accounts and token-based API access on a self-hosted Mattermost server, inside infrastructure you control. Each engagement starts with a written scope that defines which integrations, channels and permissions are in play before any token is issued.

How we scope

  • Inventory every integration that currently uses a personal account or token and record its owner and purpose.
  • Define the bot accounts, roles, team and channel memberships each integration needs, with least privilege as the default.
  • Agree in writing which posting rights in private channels and direct messages are in scope and who approves them.

How we build

  • Create bot accounts, configure personal access token settings and set up token storage in your secrets manager.
  • Test posting, reading and administration calls against a staging server before anything reaches production channels.
  • Verify that removing a departing employee does not break any bot-driven workflow, and document the result.

How we hand over

  • Deliver a register of bot accounts, token owners, scopes, rotation steps and the channels each bot can reach.
  • Document the runbook for rotating, revoking and replacing tokens, including who is notified and in what order.
  • Walk your administrators through the setup and confirm they can reproduce rotation and revocation without DeployOpen.

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer, including checks after each Mattermost server release.
  • Ask us to confirm the bot and token behavior of your exact Mattermost version and plan before you commit to a design.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.