Overview
What is its Purpose?
- Protects system resources by limiting body size of requests coming through API Proxy.
- Prevents high-volume requests from reducing service performance and unexpected timeout issues.
- Protects backend services by stopping data transfers outside defined trusted limits at early stage.
- Supports quick error debugging on client side with optional error message customization.
Working Principle
- Request Arrival: For each HTTP/HTTPS request arriving at the API Gateway, the source IP address of the request is identified.
- Policy Check: If the Maximum Message Size policy is active, the system checks in the following order:
- Is a Condition defined? If so, is the condition met?
- Is the policy active (active=true)?
- Is a Variable being used or is Apinizer default?
- Message Size Measurement: Length of request body in bytes is read and compared with defined
sizevalue. - Decision Making:
- Match Found: If request size is smaller than defined limit, transmission continues.
- No Match: When size limit
>= size, request is blocked and configured error message is returned.
- Error Handling: Customizable HTTP status code and error message are returned for requests that do not comply with the policy rule. Default 403 ERR-027 code is sent.
Features and Capabilities
Basic Features
- Byte-Based Message Restriction: Stops operation when defined limit is reached by measuring request body length in bytes.
- Instant Blocking Mechanism: Prevents load on backend services by cutting chain as soon as limit overflow is detected.
- gRPC Compatible Validation: Same rule set can be used in both HTTP and gRPC calls thanks to
availableForGrpc()support. - Active/Passive Status Control: Easily change the active or passive status of the policy (active/passive toggle). In passive mode, the policy is not applied but its configuration is preserved.
- Condition-Based Application: Determine when the policy will be applied by creating complex conditions with Query Builder (e.g., only for specific endpoints or header values).
Advanced Features
- Limit Determination by Condition: Different limits can be defined specific to certain endpoints, headers, methods, or user segments with Query Builder.
- Error Message Localization: Provides understandable feedback on client side with custom error codes and messages, compatible with multi-language support.
- Policy Usage Tracking: API Proxies, Proxy Groups, and Policy Groups using it can be monitored from a single screen.
- Export/Import Feature: Export policy configuration as a ZIP file. Import to different environments (Development, Test, Production). Version control and backup capability.
- Policy Group and Proxy Group Support: Manage multiple policies within Policy Group. Bulk policy assignment to Proxy Groups. Centralized update and deploy operations.
- Deploy and Versioning: Deploy policy changes to live environment. See which API Proxies use it (Policy Usage). Proxy Group and Policy Group usage reports.
Usage Scenarios
Configuring Policy Parameters
In this step, users can create a new policy or configure existing policy parameters to define access rules. The defined parameters directly affect how the policy works (e.g., which IPs will be allowed, geographical restrictions, conditional activations, etc.). This allows the policy to be customized according to organization-specific requirements while being centrally manageable.Creating a New Maximum Message Size Policy

Configuration Steps
For descriptions of Conditions and Error Message Customization panels, you can review the Conditions and Error Message Customization sections on the What is Policy? page.
For a complete guide on all layers, priority order and scenario examples of the error message configuration system, see the Error Message Configuration Guide page.

