Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 3 of 5

Policies

9 min

Listen to this lesson

0:00 / 8:18

Policies are where API Management earns its place. SAP's learning material describes more than 40 out-of-the-box policies, grouped broadly into security, traffic management and mediation. Each policy is a small, configurable rule attached at a specific point in the request or response flow. Getting the attachment point and the order right matters as much as the policy itself.

Where policies attach

  1. Proxy endpoint, request PreFlowFirst contact with the consumer: verify the API key or token, spike arrest, quota, threat protection.
  2. Conditional flowsRules for one operation or path, such as a preflight OPTIONS request or a write operation.
  3. Target endpoint, requestPrepare the backend call: add backend credentials, remove the consumer's key, transform the request.
  4. BackendS/4HANA processes the call.
  5. Response flowsShape the payload, set CORS headers, map backend errors to the agreed error body, cache.
The points where policies run on one API call. Each endpoint has a PreFlow, conditional flows and a PostFlow.
The Sign-Off Table · thesignofftable.com/academy/sap-int-204

Put checks that reject bad calls as early as possible. SAP's tutorial attaches Verify API Key to the proxy endpoint's PreFlow on the incoming request, so a call without a valid key is rejected before anything else runs. There is no point spending backend capacity or quota on a call you will refuse.

Checks that refuse calls run first, so a refused call never spends quota or backend capacity.
The Sign-Off Table · thesignofftable.com/academy/sap-int-204

The policies you will use most

GroupPolicyWhat it doesContoso use
SecurityVerify API KeyChecks that the call carries a valid key for a registered applicationEvery call from Great Lakes Fleet Services' portal
SecurityOAuth v2.0Issues or verifies access tokensContoso's own mobile app acting for a signed-in user
SecurityThreat protection (JSON, XML, regular expression)Rejects oversized, deeply nested or malicious payloadsWrite operations that accept a request body
TrafficSpike ArrestSmooths sudden bursts to a maximum rateProtect CMP from a portal bug that loops
TrafficQuotaCaps calls per application over a period, such as an hour or a dayContractual limit per fleet customer
TrafficResponse CacheServes repeated identical reads from cache for a set timeStatic reference data such as product lists
MediationAssign MessageSets or removes headers, variables and payload partsStrip the API key before calling S/4HANA; add CORS headers
MediationRaise FaultReturns a defined error response under a conditionAgreed error body for an unknown order
MediationKey Value Map Operations, Basic AuthenticationReads stored values and builds an authorization headerBackend credentials kept out of the proxy definition

Commonly used API Management policies. Names follow SAP's documentation; your tenant lists the full set.

Order and protection

Spike Arrest and Quota solve different problems. Spike Arrest protects the backend from bursts in seconds; Quota enforces an agreed volume per consumer over hours or days. When you need both, SAP guidance applies Spike Arrest first. Backend credentials belong in an encrypted key value map or the provider configuration, never written as text in a policy, because policies are visible to everyone who can edit the proxy.

Spike ArrestShort window, whole proxy: smooth bursts that would overload CMP
Backend capacity planningLong window, whole API: sizing S/4HANA and Cloud Connector for expected traffic
Per-application spike limitsShort window, one consumer: stop one customer's loop without affecting others
QuotaLong window, one consumer: contractual volume per fleet customer per day
Which traffic control answers which question.
The Sign-Off Table · thesignofftable.com/academy/sap-int-204
The order status proxy's policies in the order a call meets them, from the consumer's key check to the cleaned-up response.
The Sign-Off Table · thesignofftable.com/academy/sap-int-204

What would you do?

After a policy change, Great Lakes Fleet Services' calls fail with an authentication error from S/4HANA, not from the proxy. The proxy's key check passes. What is the most likely cause Theo should check?

Key points
  • Policies attach to request and response flows on the proxy and target endpoints.
  • Reject bad calls early: key or token check first in the proxy request PreFlow.
  • Spike Arrest protects against bursts; Quota enforces agreed volume per consumer.
  • Keep backend credentials in encrypted storage, and shape errors before they leave the proxy.

Check your understanding · not graded

Lesson check

  1. 1. Where should Verify API Key normally be attached?

  2. 2. Which policy enforces an agreed number of calls per application per day?

  3. 3. Why remove the consumer's API key with Assign Message before calling S/4HANA?

  4. 4. Which policy returns a defined error response when a condition is met?