Mattermost API rate limiting

Mattermost includes built-in API rate limiting that can throttle request bursts on a small server. Larger or clustered deployments usually move this control to the reverse proxy, and this page explains the trade-offs and setup.

On this page

Mattermost API rate limiting: when the built-in throttle is enough

If you need to limit API abuse on a self-hosted Mattermost, the first decision is whether the server's built-in rate limiter is enough for your user count. The limiter throttles API requests per client using settings in the server configuration, and Mattermost's documented fit is small deployments. Treat it as a first line of defense that you tune and test, not as the control you rely on for a large or regulated site.

The limiter is aimed at bursts that come from scripts, bots, misbehaving integrations and credential stuffing against the API. A runaway webhook loop or a bot polling endpoints in a tight loop can degrade service for everyone, and a throttle keeps one client from consuming the server. It does not replace reverse proxy rate limits, web application firewall rules or identity controls such as SSO enforcement, MFA and account lockout. Attackers who rotate source addresses or spread attempts across accounts can get past a per-client throttle, so login protection and proxy controls still need their own design.

Before you rely on it, confirm the limiter's exact keys, settings and default values against the documentation for the Mattermost version you run, since these change between releases. Then test with realistic bot and integration traffic in a staging environment to see how legitimate clients behave when they hit the limit. If your review shows the server cannot absorb that traffic, plan to move the limits to the proxy, as the next section explains.

Built-in limits compared with proxy limits

This table compares enforcing API limits inside the Mattermost server with enforcing them at the reverse proxy or load balancer in front of it. Read each row as a deciding question: what the limit can see, how it behaves across nodes, and how hard it is to change. The main takeaway is that identity-aware limits and multi-node consistency usually point toward the proxy as sites grow.

FactorBuilt-in Mattermost limitsReverse proxy or load balancer limits
Where the limit is enforcedInside the Mattermost application server, before request handling completesAt the edge, before requests reach any Mattermost node
Identity it can seeAuthenticated user and request path as Mattermost resolves themClient address, headers and path; user identity only if the proxy authenticates the request
Behavior across multiple application nodesCounters are per node unless the server coordinates them; confirm this in the current docs for your versionSingle shared policy at the edge, though the proxy tier itself must be redundant
Changes that need a server restartSettings changed in the server configuration; confirm which keys require a restartChanges applied by reloading proxy configuration, usually without touching Mattermost
Effect on blocked trafficRequests reach the application tier before being rejected, using server resourcesRejected requests stop at the edge and never reach the application or database
Fit for small deploymentsSimple to set up in one place and suited to a few hundred usersAdds a component to operate, which can be more than a small team needs
Fit for larger sitesHarder to keep consistent as nodes are added and traffic growsPreferred for consistent enforcement, provided limits are tuned from your own traffic baseline
Values to setTake thresholds from your traffic baseline and the current Mattermost documentationTake thresholds from your traffic baseline and your proxy vendor's documentation

Where each rate limit can sit in the request path

Mattermost API rate limiting is one layer among several. Each control in the request path sees a different slice of traffic, so a limit at one point rarely protects every route. Compare what each layer can observe before deciding which limits to set where.

Mattermost application limiter

The built-in limiter runs inside the Mattermost server and throttles API requests by the identity it can see, such as a user or client address. It understands application routes, so it can protect expensive API calls differently from cheap ones. It misses traffic that is rejected before reaching the application, including floods that exhaust connections or CPU at the proxy. Its counters are held per server, so on a multi-node cluster confirm how limits are shared across nodes before relying on exact thresholds. It mainly stops a single client or script from overloading the application.

Deployment planning docs

Reverse proxy per-address limit

A proxy limit such as a request rate keyed on the client address sits in front of Mattermost and rejects excess traffic before the application spends resources on it. It stops floods and crude scraping from a single address, and it works even when the application is slow or down. It sees only the connection address, so users behind a shared NAT, VPN or corporate egress can hit the same bucket. Confirm that the proxy reads the real client address from its trusted forwarding headers, or every user will appear as the proxy itself.

Per-route limit for sensitive endpoints

A narrow limit on login, password reset and token-issuing routes targets credential guessing rather than general volume. Set it in the proxy so that it applies only to those paths and uses a stricter threshold than the general API. It misses attacks that spread attempts across many addresses, so pair it with account-level lockout and login attempt controls in the application. Test the limit against your SSO redirects, since a too-tight rule can block legitimate sign-ins during an identity provider outage and retry storm.

WAF or edge provider limit

A web application firewall or CDN edge limit runs before traffic reaches your network, so it absorbs volumetric attacks that would otherwise consume bandwidth and proxy capacity. It can match on signals the proxy does not see, such as bot scores and geography. It adds a third-party dependency and may not fit an air-gapped or strictly on-premises design. Confirm where TLS terminates, because an edge provider that inspects traffic changes your data handling position and your encryption model.

Per-token limits for bots and webhooks

Integrations, bots and incoming webhooks authenticate with tokens and often run unattended, so a leaked or misbehaving token can generate heavy traffic that looks legitimate. Per-token budgets, or a dedicated proxy rule keyed on the integration's route and token, isolate one integration from the rest of the workforce. These controls cannot see user-level behavior and depend on token identity being stable. Inventory every bot and webhook owner, and confirm which limits Mattermost applies to each token type in your version.

How a request meets the proxy and the Mattermost limiter

A client or integration sends its request to the edge, which passes it through the reverse proxy and its rate limit before the load balancer routes it to a Mattermost application node. The node's built-in limiter applies its own throttle, then queries the PostgreSQL primary. Check where the client address is read: the Mattermost node only sees the proxy's address unless the forwarded header is trusted and set correctly by the proxy.

Request path from client to database, showing the trust boundary and where client address is read.

Choosing limits by deployment shape

With one application server and no load balancer, the built-in limiter sees every request, so it can carry the main load. Per-node counting is not a concern because there is only one node to count on. Limits should be tuned to the capacity of that server and the number of users it serves, not copied from another deployment.

  • Main limiter: The built-in server rate limiting, set in the server configuration, enforces the limits. A reverse proxy in front is optional and only needed for TLS termination or access logging in your design.
  • Burst behavior: A burst from one client can slow sessions for everyone on the same server, so burst settings matter as much as the average rate.
  • Baseline: Start from the defaults, then adjust using load test results from your own traffic pattern.
  • Memory use: Confirm how much memory the limiter's store uses at your user count, and how it handles many users behind one shared address.
  • Upgrades: Setting names and limiter behavior can change between releases, so retest limits after each upgrade.

Check which identifier the limiter keys on (client address, user or both) and confirm the setting names for your exact server version in the Mattermost configuration documentation.

Setting up rate limits in the right order

This sequence moves from observing real traffic to enforcing limits in layers, so throttling blocks abusive or runaway requests without stopping users, mobile apps, bots or monitoring. Each step produces evidence that the next one depends on.

  1. Measure normal API and WebSocket traffic

    Before changing any setting, the platform or security team records how requests reach the server over a representative period. Pull request counts per endpoint, per authenticated user and per client type from the reverse proxy access logs, and note peak rates for login, search, file upload and WebSocket connections. Ask Mattermost support or your own monitoring team which metrics the server exposes, since the exact metric set depends on the installed version and how metrics are enabled. The step is done when you have a baseline table of normal peak rates per endpoint that the team has reviewed and agreed.

  2. Separate clients that need different treatment

    Group the baseline traffic into classes: human users on web and desktop, mobile apps, bots and webhooks, third-party integrations, and monitoring probes. Each class has different burst patterns, so one global threshold will either block bots during normal sync or leave browsers exposed to abuse. Assign an owner to each class who can say what normal looks like. The step is done when every observed client type maps to exactly one class and the owners have signed off on the list.

  3. Set the built-in limiter conservatively

    Configure Mattermost's built-in rate limiter in the server configuration file with generous thresholds that sit above the observed peaks. Confirm the exact configuration key names, default values and whether the limiter applies per IP address or per user against the documentation for your installed version, because names differ between releases. Apply the change in staging first, restart the service under your normal process, and record the change in version control. The step is done when the server starts cleanly with the new values and the configuration matches what you reviewed.

  4. Add proxy limits for authentication and sensitive routes

    Place tighter limits at the reverse proxy or API gateway on login, password reset, token creation and other sensitive routes, where brute force and credential stuffing attempts concentrate. Keep the proxy limits keyed to the client address the proxy can see, and confirm that the proxy passes the real client address to Mattermost so per-user limits are not applied to a shared load balancer address. Coordinate these routes with the SSO flows so redirects are not throttled. The step is done when a test script sending repeated failed logins receives 429 responses from the proxy and the proxy log records the rejected requests.

  5. Exempt health checks and load balancer probes

    Identify the health check URL, load balancer probe and monitoring agent requests from the baseline, then exclude them from both the built-in limiter and the proxy limits. If probes are throttled, the load balancer may mark healthy nodes as down and cause an outage that looks like a capacity problem. Restrict each exemption to the known source addresses or a dedicated path, and document it so reviewers can see that the exemption is narrow. The step is done when repeated probe requests return healthy responses at a rate above the normal user limit, and the exemption list is recorded with its owner.

  6. Test with a load tool against staging

    Run a load testing tool against a staging copy of the deployment with the same proxy, configuration and approximate user count as production. Script three scenarios: normal user sessions at baseline rates, a bot or integration at high sustained rates, and a burst against login. Watch for the point where each class starts receiving 429 responses and check that the threshold matches the intended value. Ask whether the staging database and file storage are sized like production, because results from an undersized environment can mislead. The step is done when each scenario produces the expected throttling and the team has written down the thresholds observed.

  7. Verify in production logs and metrics

    After rollout, review proxy logs and server metrics for 429 responses grouped by endpoint, client class and user. Look specifically for legitimate users, mobile sessions, integration accounts and probes that appear in the throttled set, and tune the thresholds or exemptions if they do. Keep an alert on the 429 rate so that a sudden rise is investigated rather than ignored. The step is done when a review period passes with no legitimate client class in the throttled set, and the team has recorded the alert and its owner.

Security risks when limits are too loose or too tight

Rate limits protect Mattermost from abuse, but the same settings can lock out legitimate users or hide an attack. The cards below cover the failure modes that show up most often, with the control that addresses each one and what to verify on your own server.

Unlimited authentication endpoints

If login and password reset endpoints sit outside your rate limits, an attacker can script password guesses at whatever speed the network allows. Limits on these paths should be stricter than limits on general API traffic. Verify with a test account that repeated failed logins are throttled, and confirm that the login attempt settings in the server configuration match what your policy requires. Also check that the reverse proxy does not bypass these limits for the login route.

Limits keyed only on client address

When all limits track the client IP address, users behind a shared NAT gateway, corporate proxy or VPN exit can share one counter. A single busy user then blocks everyone behind that address. Ask whether your proxy forwards the real client address and whether the application trusts that header only from known proxy hosts. Test by sending traffic from two accounts behind the same egress address and confirming that one does not exhaust the other.

Bot tokens that trigger business outages

Integrations, bots and scheduled jobs often send bursts of requests during peak periods, such as release windows or incident alerts. If their tokens share a limit with interactive users or fall below the burst they need, the integration fails and the business process stops with it. Inventory every bot and integration token, estimate its peak request rate from logs, and set limits for those accounts deliberately. Confirm that a throttled integration returns a clear error that its owner can see.

Limits that differ across nodes

In a clustered deployment, each application node may enforce limits independently, so the effective limit is the configured value multiplied by the number of nodes. An attacker who spreads requests across nodes, or who reaches a node through a different path, can exceed the intended rate. Confirm with your Mattermost high availability design whether limit state is shared, and test by sending the same burst through each node and through the load balancer.

Logging gaps that hide throttled traffic

A throttled request that leaves no record prevents the security team from seeing brute force attempts, scraping or a compromised token. Throttling and access logs should record the account, token identifier, client address and the decision made, and those logs should flow to your central log store. Verify that a deliberate burst from a test account appears in the security log with a rejection status, and that alerts fire when throttled volume crosses a threshold you set.

Why larger sites move limits to the proxy

Once a Mattermost deployment runs several application nodes or serves heavy integration traffic, enforce request limits at the reverse proxy or load balancer rather than relying only on the server's built-in limiter. The proxy sees every request before it reaches a Mattermost node, so it can reject abusive traffic at the edge and keep that traffic away from the application and its PostgreSQL primary. The built-in limiter tracks counters inside each node, which means limits do not add up across a cluster in the way an edge limiter does. Confirm how your chosen proxy shares counters between its own instances, since a limiter that keeps state per proxy node will be looser than the number you configured.

Edge limits can target routes separately. Login endpoints, the REST API under /api/v4, WebSocket connections and file upload paths carry very different load and risk, so give each its own rule and its own threshold. Login protection is the most common reason to split them, because credential-stuffing traffic should be slowed without throttling users who are already signed in. Keep the SSO callback and any pre-authentication endpoints on a rule you have tested end to end, so a limit does not break sign-in for mobile or desktop clients. Document each rule in the same place as your cluster design.

The proxy has limits of its own. It generally cannot see which Mattermost user made a request unless it parses authentication tokens, and parsing session tokens at the edge adds configuration and a dependency that must be maintained. Plan for the proxy to limit by client address or token presence, and accept that users behind a shared corporate NAT may share one bucket. Because the high availability guidance calls for redundant load balancers, treat the proxy layer as part of the cluster: document its configuration, include limit behavior in failover tests, and confirm with your proxy vendor how limits behave during a node replacement.

Limits to confirm in your environment

Built-in rate limiting depends on configuration keys, network topology and traffic patterns that differ between sites and versions. The checks below connect the settings you rely on to how requests actually reach the server, so each limit does what you expect.

Configuration keys and defaults

Confirm the exact rate limiting keys, their default values and their units against the documentation for the Mattermost version you run. Defaults and key names can change between monthly releases and Extended Support Releases, so a setting copied from an older guide may not apply. Record the values in your deployment configuration, and check them again after every upgrade so a change in defaults does not go unnoticed.

Server releases

Per node or cluster-wide scope

Determine whether the built-in limiter counts requests per application server or shares counts across the cluster. In a multi-node topology, a per node counter lets a client's requests spread over several servers exceed the intended total. Test with traffic routed through your load balancer, and confirm the behavior in the high availability documentation for your release.

High availability docs

Client address behind the proxy

Verify that the server sees the real client address, not the address of the reverse proxy or load balancer. If every request appears to come from one address, all users share a single limit bucket and one busy client can lock out the rest. Check the forwarded address headers your proxy sets, which headers the server trusts, and whether untrusted clients can spoof them.

WebSocket and mobile traffic

Establish whether WebSocket connections, mobile clients and desktop apps draw from the same limits as browser API calls. Real-time connections can generate high request volumes from a single client, and mobile reconnects after network changes can trigger bursts. Measure these patterns in your own logs before setting thresholds, since a limit that suits browser traffic may disconnect or slow mobile users.

SSO and pre-authentication flows

Check how limits apply to login redirects, SSO callbacks, token exchanges and requests that carry the pre-authentication secret header. Identity provider callbacks arrive from a few addresses in bursts, and a throttle placed in front of them can block every user at sign-in time. Test each SSO path and mobile login after applying limits, and confirm exemptions with the current authentication documentation.

SAML single sign-on docs

Questions buyers ask about rate limiting work

How much does Mattermost API rate limiting work cost?

The cost depends on who does the work and how much of it is one-time. A typical engagement covers traffic analysis (reading logs to find normal API use by people, bots, webhooks and mobile clients), proxy configuration, staging tests, and monitoring after go-live. Baseline analysis, policy design, proxy changes and test plans are usually one-time items. Monitoring, reviewing limits when a new integration is added, and adjusting limits after each server upgrade recur. Costs rise with the number of integrations, the number of proxy layers, the number of Mattermost nodes, and how much client identity detail the logs lack. DeployOpen works under fixed scope agreed in writing, and ongoing review is available as a retainer. Ask any quote to separate one-time work from recurring work, list each client type covered, and state what the client must supply before work starts.

How long does it take to set up API rate limits?

The duration depends on four factors: how much traffic history you have, how many client types must be tested, how many environments need changes, and when your change windows fall. If your logs cover only a short period, the work must wait for a representative window that includes normal weekdays, month-end peaks and scheduled jobs. Each mobile app version, integration and bot needs its own test pass in staging before limits reach production. Production proxy changes often wait for approved change windows, which can add calendar time even when the technical work is short. Ask for a written timeline that names the traffic collection period, the staging test window, each production change window and the monitoring period after go-live. A timeline without these milestones usually hides the dependencies that move it.

What does our team need to provide for rate limiting work?

The work needs access and information that only your team can supply. Provide application and proxy logs covering normal and peak periods, with enough detail to identify the client, endpoint and user or service account behind each request. Give read and change access to the reverse proxy configuration, or to the repository that manages it, and admin access to the Mattermost System Console for the settings under review. A staging environment that matches production in proxy layout, Mattermost version and database is needed so limits can be tested before release. Name an owner for each integration, bot and mobile release channel who can confirm expected request patterns and approve changes. Finally, share your change calendar so production work lands in an approved window and the people who handle incidents know when limits are changing.

Can our own team set up Mattermost rate limiting without a partner?

A capable team with proxy and Mattermost administration skills can do this alone, provided it has time for traffic analysis and staging tests. Mistakes usually happen in predictable places. Teams set limits from guesses instead of measured traffic. They limit by IP address even though many users may share one address through a VPN, NAT or office gateway, so legitimate users get throttled together. They forget websocket, mobile and health-check endpoints, or they apply one limit to bursty integrations and steady human traffic alike. Teams also change the built-in limiter and the proxy limiter without recording which layer enforces what, which makes incidents hard to diagnose. Finally, many teams test only from a browser and discover mobile or webhook failures after release. A written test matrix covering each client type prevents most of these problems.

Is the built-in Mattermost rate limiter enough for our size?

The built-in limiter is suited to smaller deployments. The page guidance is that it fits deployments of a few hundred users, and larger sites should move limits to the reverse proxy or load balancer. Confirm this boundary against the current Mattermost documentation, because limiter settings and behavior can change between releases. The server deployment planning guide explains how deployment shape affects where controls belong, and the high availability documentation describes multi-node designs with redundant application servers and load balancers, where a shared proxy policy is easier to keep consistent. A simple test is whether requests from one client can reach the application layer in a way that affects other users. If the answer is yes, or if you run several nodes behind a load balancer, plan proxy-layer limits and confirm the settings before go-live.

Will API rate limits break mobile apps and integrations?

Yes, if limits are set without testing each client. Mobile apps reconnect and retry after network drops, so a limit that looks reasonable for steady use can throttle a phone that wakes up on a poor connection and sends a burst of requests. Integrations such as webhooks, bots, CI notifications and scheduled exports often send bursts at fixed times, which can exceed a limit set for interactive users. Before production, confirm how each mobile app version and integration responds when it receives a throttled response, including the status code and retry behavior that the Mattermost documentation describes for your version. Stagger scheduled jobs where possible, set limits per endpoint group instead of one global value, and give integration owners a clear way to report failures. Keep a rollback path in the proxy configuration so a bad limit can be reversed quickly.

How DeployOpen scopes and delivers Mattermost rate limiting

DeployOpen treats Mattermost API rate limiting as a planned part of the server, the proxy and the cluster, not a single setting. We begin by mapping which clients, bots and integrations call the API, then agree on where limits belong and how they will be tested and handed over in your infrastructure.

How we scope

  • Inventory of API clients, bots, webhooks, integrations and mobile traffic that will hit your server
  • Decision record on built-in limits versus proxy limits, based on your user count and deployment layout
  • Written scope listing configuration changes, test cases, documentation and handover items, agreed before work starts

How we build

  • Configure built-in rate limits in the server settings for the request profile agreed in scope
  • Build proxy-level limits, keyed by client or token, for each route your sites need to protect
  • Test throttling behavior against representative load, including how legitimate bursts and integrations respond

How we hand over

  • Runbook documenting each limit, its owner, its reason and the change process for raising it
  • Dashboards and alert rules for throttled requests, so your operations team can see limits working
  • Walkthrough with your platform and security teams covering upgrade checks that touch rate limit settings

How we support

  • Fixed-scope engagements with deliverables and timelines agreed in writing before work starts
  • Ongoing support, upgrades and continuous testing available as a retainer after handover
  • Retests after Mattermost releases or traffic changes, scoped in writing with your team

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.