Skip to main content
This document explains the detailed usage of a specific policy. If you are using Apinizer policies for the first time or want to learn the general working principles of policies, we recommend reading the What is Policy? page first.

Overview

What is its Purpose?

  • Transform data on request or response according to business rules with action chains to make it consistent.
  • Normalize content coming from different data sources to ensure integrity in API Proxy flow.
  • Apply business logic only in specific endpoint flows with conditional rule execution.
  • Keep sensitive fields that need to be masked or removed under control at policy level.

Working Principle

  1. Request Arrival: For each HTTP/HTTPS request arriving at the API Gateway, the source IP address of the request is identified.
  2. Policy Check: If the Business Rule 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?
  3. Action Chain Execution: Action list is evaluated sequentially; each action applies operators according to selected data type (numeric/string/temporal), extracts JWT claims if needed, or performs JSON/XML transformation.
  4. Decision Making:
    • Match Found: All actions are applied; request’s payload, header, or variables are updated.
    • No Match: Policy is skipped; request continues in flow with current state.
  5. 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

  • Action Chain Management: Sequential operations are defined on variables in the request with action types like Add, Modify, Delete, Stop.
  • Data Type-Based Operator Support: Different operators (e.g., Substring, Add Temporal, Multiply) can be selected for Numeric, String, and Temporal data types.
  • Advanced Transformation Capability: JSON↔XML transformations, XSLT/JOLT-based manipulations, and URL encode/decode operations are performed within action scope.
  • 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

  • JWT Claim Extraction: JWT contents can be retrieved to variables with Extract JWT Header Claim and Extract JWT Body Claim operators.
  • Variable Management Integration: Project variables can be selected as source and target, updated from dialog screen if needed.
  • Transformation Profile Settings: Null, empty, and array behaviors in JSON to XML / XML to JSON transformations are managed with fine-tuning.
  • 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 section, you can create a new Business Rule policy or configure existing policy parameters to define access rules.

Creating a New Business Rule Policy

Policy Definitions and Actions menu (Add, Modify, Delete, Stop) In the Policy Definitions section, use the Actions dropdown to add a new action or choose its type. The following action types are available: Depending on the selected action type, the Action Definition - Add or Action Definition - Modify modal opens, where you define Injection Target and Conditions.

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.

Deleting the Policy

For deletion steps of this policy and operations to be applied when in use, you can refer to the Remove Policy from Flow section on the Policy Management page.

Exporting/Importing the Policy

For export (Export) and import (Import) steps of this policy, you can refer to the Export/Import page.

Connecting the Policy to API

For the process of how this policy will be connected to APIs, you can refer to the Connect Policy to API section on the Policy Management page.

Advanced Features

Best Practices

Things to Do and Best Practices

Security Best Practices

Things to Avoid

Performance Tips

Frequently Asked Questions (FAQ)