A policy is a customizable rule the gateway executes during an API transaction — covering security, transformation, performance, routing, or monitoring. You add policies to flows to enforce security, keep data transfer reliable, and shape traffic. This guide is for publishers configuring an API's policies; it lists every policy available to API Management subscribers, which plan tier includes it, and which API definition versions support it. For how to add a policy to a flow, see Configure your API in the APIM console.
API Management is available on two tiers: Standard and Advanced. The Advanced tier includes every Standard policy plus the two listed in the second table below.
Standard plan policies
| Policy | Description | v2 | v4 |
|---|---|---|---|
| API Key | Enforces API key checks during request processing, allowing only apps with approved, unrevoked, unexpired keys to access the resources your API defines. | ✓ | ✓ |
| Assign Attributes | Sets variables — request attributes, message attributes, and other execution-context attributes — for reuse by later policies such as Dynamic Routing or role-based access control. | ✓ | ✓ |
| Assign Content | Transforms the request or response body using the Freemarker template engine, including XML-to-JSON conversions and similar changes. Can read the request and response bodies, dictionaries, and context attributes from the template context. | ✓ | ✓ |
| Basic Authentication | Compares the username and password in a request's basic authentication header against an APIM user to validate credentials. Requires an LDAP, inline, or HTTP resource configured on your API plan to specify where APIM users are stored. | ✓ | ✓ |
| Cache | Caches upstream responses (content, status, and headers) to avoid repeat backend calls, based on a cache resource tied to the API's lifecycle. A consumer can bypass the cache with a cache=BY_PASS_ query parameter or an X-Gravitee-Cache=BY_PASS header. |
✓ | ✓ |
| Dynamic Routing | Dispatches inbound calls to different targets or endpoints, or rewrites URIs — useful for building API mashups. | ✓ | ✓ |
| Generate HTTP Signature | Produces an HTTP signature from a set of headers, a maximum validity duration, and other settings, authenticating the client with a private asymmetric key (such as RSA) or a shared symmetric key (such as HMAC). | ✓ | ✓ |
| Generate JWT | Generates a signed JWT with a configurable set of claims and stores it in the jwt.generated request execution-context attribute for use by later steps — for example, when your front end authenticates with an API key but your backend expects a JWT. |
✓ | ✓ |
| GeoIP Filtering | Controls access by filtering IP addresses based on country or distance. | ✓ | ✓ |
| Groovy | Runs a Groovy script at any stage of gateway request processing. | ✓ | ✓ |
| HTML to JSON | Transforms response content from HTML to JSON using the jsoup parser; you provide the JSON field names and their corresponding selectors. | ✓ | ✓ |
| HTTP Callout | Invokes an HTTP(S) URL during request processing and stores some or all of the result in the calloutResponse execution-context variable, available only during that policy's execution. Useful when you need data from an external service mid-request. |
✓ | ✓ |
| HTTP Signature | Requires the consumer to sign requests with a secret key, confirming the request's origin and integrity. | ✓ | ✓ |
| IP Filtering | Allows or denies specific IP addresses or CIDR ranges. In allowlist mode, only listed addresses pass; in blocklist mode, every address except the listed ones passes. If an address appears in both lists, the blocklist takes precedence and the request is rejected. You can also resolve a hostname and check it against the remote IP. | ✓ | ✓ |
| JSON Threat Protection | Rejects a request with 400 BAD REQUEST when its JSON body exceeds limits you set on structures such as arrays, field names, or string values. |
✓ | ✓ |
| JSON to JSON | Transforms or remaps request, response, or message content using the JOLT library. | ✓ | ✓ |
| JSON to XML | Transforms JSON content to XML. | ✓ | ✓ |
| JSON Validation | Validates a JSON payload against a JSON Schema, returning 400 BAD REQUEST for a failed request or 500 INTERNAL ERROR for a failed response, each with a custom error body. Can also inject processing-report messages into request metrics for analytics. |
✓ | ✓ |
| JSON Web Signature | Validates a JWS token's signature, certificate information, and expiration before the request reaches the backend. | ✓ | ✓ |
| JWT | Validates a JWT's signature and expiration before the request reaches the backend. | ✓ | ✓ |
| Keyless | Considers every request valid by default and doesn't block any of them. | ✓ | ✓ |
| Latency | Adds a configured delay to a request or response — useful for testing how client applications behave against a slow API, or for encouraging consumers on a free plan to upgrade. | ✓ | ✓ |
| Metrics Reporter | Pushes request metrics to a custom endpoint, built with the Freemarker template engine, while still returning the complete response to the original consumer. | ✓ | — |
| Mock | Returns a mock response instead of calling the backend, for testing without live data. | ✓ | ✓ |
| OAS Validation | Validates requests and responses against the API's embedded OpenAPI specification. See Configure and publish APIM documentation for how the spec relates to the API definition. | — | ✓ |
| OAuth2 | Checks access token validity through token introspection, using the token supplied in the Authorization header; invalid tokens are rejected before the request proceeds. | ✓ | ✓ |
| OpenID Connect UserInfo | Retrieves OpenID Connect user information from an OAuth2 resource's UserInfo endpoint. | ✓ | ✓ |
| Override HTTP Method | Replaces the HTTP method the consumer sent with a configured value before forwarding the request to the backend. | ✓ | ✓ |
| Rate Limiting | Covers three related policies: Quota (requests allowed over hours, days, weeks, or months), Rate-Limit (requests allowed over seconds or minutes), and Spike-Arrest (throttles request bursts before they reach the backend). | ✓ | ✓ |
| Regex Threat Protection | Evaluates request content (headers, path, query parameters, body) against regular expressions you define, rejecting a match with 400 BAD REQUEST and logging it to request metrics. |
✓ | ✓ |
| Request Content Limit | Rejects a request whose content-length header exceeds a maximum you set. | ✓ | ✓ |
| Resource Filtering | Restricts or allows access to a resource by path and HTTP method — commonly used in plan configuration to give a subscriber read-only (GET) access to every path. |
✓ | ✓ |
| REST to SOAP | Exposes a SOAP backend as a REST API, passing the SOAP envelope to the backend as a POST request. Envelopes support Expression Language for dynamic SOAP actions. | ✓ | ✓ |
| Retry | Replays a request when it hits a backend connection issue or meets a condition you define. | ✓ | ✓ |
| Role Based Access Control | Restricts a resource to specific roles, in either strict mode (every configured role must match) or any-match mode (at least one configured role must match). | ✓ | ✓ |
| SSL Enforcement | Restricts or allows access based on client certificate authentication, or to a specific subset of valid clients. | ✓ | ✓ |
| Traffic Shadowing | Duplicates a request asynchronously and sends the copy to a second endpoint defined at the API level, optionally adding headers to the duplicate. | ✓ | — |
| Transform Headers | Overrides request or response HTTP headers: adds or updates headers, removes individual headers, or defines an allowlist. | ✓ | ✓ |
| Transform Query Parameters | Overrides incoming query parameters: clears all of them, adds or updates specific ones, or removes individual ones. | ✓ | ✓ |
| URL Rewriting | Rewrites URLs found in a response header or body. | ✓ | ✓ |
| Validate Request | Validates an incoming request against rules you define, using Expression Language against query parameters, path parameters, or the body — for example, to confirm identity after an OpenID Connect UserInfo policy has run. | ✓ | ✓ |
| XML to JSON | Transforms XML content to JSON. | ✓ | ✓ |
| XML Threat Protection | Rejects a request with 400 BAD REQUEST when its XML body exceeds limits you set on elements, entities, attributes, or string values. |
✓ | ✓ |
| XML Validation | Validates XML against an XSD schema, returning 400 BAD REQUEST with a custom error body on failure and logging the failure to request metrics. |
✓ | ✓ |
| XSLT Transformation | Applies an XSL transformation, based on the Saxon library, to an XML request or response body. | ✓ | ✓ |
Advanced plan policies
Available in addition to every Standard plan policy above.
| Policy | Description | v2 | v4 |
|---|---|---|---|
| Assign Metrics | Pushes custom metrics alongside the metrics APIM collects natively, for use in dashboard widgets or in metered billing, where it generates the system metrics that tie usage to a specific plan or customer. | ✓ | ✓ |
| Data Logging Masking | Conceals sensitive data in logs, identified by a JSON path, XML path, or regular expression. | ✓ | — |