WSO2
October 14, 2026
Tested on: WSO2 API Manager 4.7.0 (all-in-one, classic Gateway), JDK 21
In This Blog
Most rate limiting problems we see in WSO2 projects come from a limit nobody can explain: copied from a default tier, never tested, and discovered only when a partner’s batch job starts receiving HTTP 429 on a Monday morning.
This guide shows how Tellestia's WSO2 API Manager team designs, applies and tests rate limiting in WSO2 API Manager 4.7, and what changes when you move from one Gateway to a production cluster. It is written for API architects, developers and platform administrators.
Rate limiting or throttling? WSO2 uses the terms interchangeably. Either way, the Gateway rejects requests above a defined limit with HTTP 429 Too Many Requests.
What you need: WSO2 API Manager 4.7.0, JDK 21 or 25, admin access to the Admin Portal and Publisher, a Developer Portal account and curl. WSO2 API Manager 4.7 can also drive the new API Platform Gateway; this guide covers the classic Gateway, which remains the default.

You define policies in the Admin Portal and apply them in the Publisher, which deploys the API to the Gateway. Consumers subscribe through the Developer Portal and get tokens from the Key Manager. At runtime, the Gateway checks each request against every policy that applies. It also sends request events to the Traffic Manager, which counts traffic across all Gateways and tells them when a limit has been crossed.
That last step matters. Because the Traffic Manager evaluates traffic asynchronously, a cluster can let a few extra requests through before the throttle decision reaches every Gateway. WSO2’s own access control documentation notes that at least one request passes each time a blocking condition is enforced. Treat limits as near real-time controls and keep a margin below what your backend can actually handle.
WSO2 API Manager offers several policy types, and each one answers a different question:
| Policy type | Created in | Applied in | What it controls |
| Subscription policy (business plan) | Admin Portal | Publisher offers it; consumer picks it when subscribing | Requests from one application to one API. Supports burst control. |
| Application policy | Admin Portal | Developer Portal, when the application is created | Requests from one application across all the APIs it uses. |
| Advanced policy | Admin Portal | Publisher, at API or resource level | Total traffic to an API or resource from all consumers, with optional conditions on IP, header, query parameter or JWT claim. |
| Custom policy | Admin Portal (Siddhi query) | Applies globally | Rules that span APIs, such as a cap per user across the platform. |
| Deny policy | Admin Portal | Applies globally | Blocks an API, application, IP address or user outright. |
A request has to pass every policy that applies to it, so the tightest one wins. A consumer on a generous subscription plan can still be throttled by an advanced policy that protects a fragile resource, which is exactly what you want.
Start from what the backend can sustain, not from a round number. If a backend handles 50 requests per second at acceptable latency, an API-wide limit of about 40 per second (2,400 per minute) leaves headroom for retries, health checks and the counting margin described above.
In the Admin Portal (https://:9443/admin), open Rate Limiting Policies, then Subscription Policies, and add a policy. For example, a Standard plan of 1,000 requests per minute with burst control at 20 requests per second, and a Premium plan of 5,000 per minute with a higher burst limit.
Burst control stops a consumer from spending a whole minute’s quota in the first second. Without it, 1,000 requests per minute can still arrive as a single 1,000-request spike.
Still in the Admin Portal, under Advanced Policies, create a policy for the total traffic the API can accept from all consumers, such as 2,400 requests per minute. Add conditional groups when one group needs a different limit, for example a tighter limit for a specific IP range.
Switch On Header, Query and JWT Conditions
Conditions based on HTTP headers, query parameters and JWT claims are disabled by default. Enable the ones you need in deployment.toml (see the configuration catalog) before relying on them:
[apim.throttling]
enable_header_based_throttling = true
enable_jwt_claim_based_throttling = true
enable_query_param_based_throttling = true
Open the API in the Publisher. In the subscription settings, select the business plans consumers can choose from. In the resource settings, set the advanced policy at API level, or per resource when one operation is far more expensive than the rest. Then deploy a new revision to the Gateway and publish the API.
In the Developer Portal, create an application and pick its application policy. For testing, choose the default 10PerMin policy so you can reach the limit in seconds. Subscribe the application to the API on the Standard plan and generate an access token.
for i in $(seq 1 12); do
curl -s -o /dev/null -w "%{http_code}\n" \
-H "Authorization: Bearer $TOKEN" \
https://localhost:8243/orders/1.0.0/items
done
The first ten requests should return 200 and the rest 429. With more than one Gateway, one or two extra requests may succeed before the limit applies.
The 429 response body carries an error code that shows which policy fired:
When support teams can see which policy fired, they can tell a consumer whether to upgrade a plan or fix a retry loop.
In production you will usually run several Gateways, so point each one at a shared Traffic Manager deployed in a highly available setup. Three practices keep distributed limits predictable:
Rate limits slow abuse down but do not stop it alone. Combine them with:
Rate limits are never finished. Track 429s per application and error code, plus backend latency and Gateway CPU. A steady rise in 900804 from one consumer usually means they have outgrown their plan, which is a commercial conversation rather than an incident. A sudden spike in 900807 usually points to a client retry loop, which is an incident.
Document your limits in the Developer Portal so consumers back off instead of hammering a throttled API, and export your policies with the API Controller (apictl) so they live in version control and move cleanly between environments.
Tellestia’s API integration and WSO2 teams run WSO2 API Manager platforms for enterprises [in regions / industries]. Planning a new API program or a move to 4.7? Book a WSO2 API Manager review and we will check your policies, topology and security against this guide. Also see our WSO2 Managed Services and API and integration governance services.
Related reading: WSO2 Micro Integrator Error Handling: Fault Sequences, Retries and Dead-Letter Patterns
Another policy fired first: an application, advanced, burst control or custom policy. The error code in the 429 response tells you which one.
Yes. Advanced policies support conditions on IP address, HTTP headers, query parameters and JWT claims. Header, query parameter and JWT conditions must be enabled in deployment.toml first.
No. The Traffic Manager counts traffic asynchronously, so a few requests can pass before every Gateway applies the limit. Size limits with that margin in mind.
WSO2 API Manager: rate limit enforcement
WSO2 API Manager: manage subscription policies
WSO2 API Manager: custom rate limiting policies
WSO2 API Manager: import and export rate limiting policies (apictl)
WSO2 API Manager: configuration catalog
WSO2 API Manager: error handling and error codes
WSO2 API Manager 4.7.0: about this release