API Manager
Logo
Execution Order of Policy

Execution Order of Policy

Logo

3 mins READ

When multiple policies govern an API, the platform applies them in a fixed order — access profile first, then API, then API Group — giving you predictable, layered control over every request.

Overview

Policies can be attached at three levels in the API Manager: the access profile, the API, and the API Group. The platform evaluates all attached policies on every incoming request, in that order. A single request can be subject to policies from all three levels simultaneously.

Understanding this order lets you build a layered governance model — broad baseline rules at the API Group, narrowed per API, and tightened further per access profile — without duplicating configuration.

Access profile → API → API Group

Policies run in this sequence on every request:

Level

What It Covers

Typical Use

Access profile

Policies attached to the access profile the caller uses. These run first and apply only to requests made with that profile's credentials.

Per-consumer rate limits, consumer-specific JWT checks, partner-level IP restrictions.

API

Policies attached to a specific API. Run second, after access profile policies pass.

Request validation for a specific route, API-level transformations, operation-specific access control.

API Group

Policies attached to the API Group. Run last, as the broadest baseline that applies to all traffic reaching that group.

CORS policy for all APIs in the group, global rate limit, response transformation applied to every response.

All three levels run on every matched request unless the chain is stopped early by a rejection at one of the levels.

Rejection and Chain Stopping

If any inbound policy — at any level — rejects a request, the chain stops at that point. Remaining policies are skipped, and the backing resource is never invoked. The caller receives the error response configured by the policy that rejected the request (commonly 400 for validation failures or 429 for rate limit exceeded).

Any counter or limit that was incremented for the rejected request is rolled back automatically, so a rejected call does not consume the caller's future allowance.

Ordering Within a Level

Within a single level — for example, when several policies are attached to one API — policies run in the order they are listed in that level's Policies section. To change the order, hover over a policy's number until it turns into a drag handle, drag the policy into place, then save your changes.

The order is set separately for the access profile, the API, and the API Group, and it never moves a policy to another level. Timeout, Cache, and IP-based access control policies are applied outside this order, so their position in the list has no effect.

Notes

  • Attach broad baseline rules (CORS, a global rate limit) at the API Group level so they apply to all callers without repetition.

  • Narrow per API with operation-specific validation or transformation policies.

  • Use access profile policies for entitlements that differ per consumer — a per-access-profile rate limit is the most common example.

  • The first rejection in the chain stops all further evaluation — place cheap checks such as rate limiting before expensive ones (custom automation policies) so fast rejections avoid unnecessary processing. The response cache check happens after inbound policies run: when a matching cached response exists, the backing resource is skipped, but access profile, API, and API Group policies still run first. IP-based access checks run before any policy in the chain.

  • A rejected request does not count against any limit — rollback is automatic and immediate.

FAQs

Can the same policy be attached at multiple levels?

Yes. A single policy can be attached to an access profile, an API, and an API Group at the same time. It runs at each level it is attached — so a rate limit attached at both the access profile and the API Group means the caller is subject to both limits, evaluated in the fixed access profile → API → API Group order. The access profile's limit is checked first.

Does a rejection at the access profile level skip API and API Group policies?

Yes. If an inbound policy at the access profile level rejects the request, the API and API Group policies are not evaluated and the backing resource is never invoked. The chain stops at the first rejection regardless of which level it occurs at.

In what order do outbound policies run?

Outbound policies, such as Response Transformer, run after the backing resource returns a response — not before. When multiple outbound policies are configured, they run in the order set in API Manager’s policy settings.

What happens if I have no policies at one level?

If no policies are attached at a given level, that level is skipped and the request passes straight through to the next. You do not need to configure all three levels — only attach policies where governance is needed.

What happens before policy evaluation begins?

The platform authenticates the caller, matches the route, and performs authorization checks — including applicable IP-based access checks — before applying any inbound policy at the access profile, API, or API Group level.