Overview
What is its Purpose?
- Blocks empty or incorrect bodies by ensuring mandatory content is carried in requests coming through API Proxy.
- Stops business rule violations at request entry by ensuring minimum data size guarantee.
- Reduces errors and unnecessary resource consumption that may occur in backend services due to missing payload.
- Helps clients quickly understand minimum requirements with error message customization.
- Activated only in sensitive endpoints or specific client segments thanks to condition-based usage.
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 Minimum 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?
- Payload Verification: Request body is converted to string, measured byte/character length is compared with defined
sizevalue. - Decision Making:
- Match Found: If body length is greater than
sizevalue, request continues in normal flow. - No Match: If body is empty or equal to/below
sizevalue, request is stopped and error message is triggered. Default error is ERR-026 and 403 Forbidden.
- Match Found: If body length is greater than
- Error Handling: Customizable HTTP status code and error message are returned for requests that do not comply with the policy rule.
Features and Capabilities
Basic Features
- Empty Body Blocking: Automatically rejects payloads that do not have request body or are below expected threshold.
- Minimum Byte Threshold Verification: Ensures data integrity by applying lowest data size defined with
sizefield. - gRPC Compatible Operation: Validates HTTP and gRPC messages with same rule 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
- Minimum Threshold by Condition: Enables defining different minimum size policies according to path, method, or header information.
- Error Message Versioning: Error messages based on EnumParentErrorType.POLICY_MINMESSAGESIZE are managed in multi-language and format-compatible manner.
- Usage Tracking Integration: API Proxies and groups using policy are monitored centrally with Policy usage tabs.
- 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 Minimum 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.

