What architectural role do API Gateways play in managing enterprise traffic entering Salesforce endpoints?
Answer
Basics: Without a gateway, every client app calls Salesforce REST endpoints directly, each with its own credentials and retry behavior. A gateway, such as MuleSoft Anypoint API Manager, Azure API Management, Apigee or AWS API Gateway, gives you one place to apply policies and to see who is calling what.
How it works:
- A client calls the gateway URL with its own client ID or token.
- The gateway checks authentication, applies quotas and throttling, validates the request schema, and may transform or cache it.
- It forwards the call to Salesforce using a single connected app and integration user.
- It handles Salesforce errors and returns a consistent response to the client.
Advanced / deep dive: The gateway protects the Salesforce API request allocation (a rolling 24-hour limit by edition and license count) and the concurrent long-running request limit. Caching of read-heavy calls cuts consumption. Using one integration identity improves control but hides the end user, so pass user context in a signed claim if Salesforce needs it. API-led connectivity in MuleSoft arranges this into system, process and experience APIs, so changes to Salesforce do not break every consumer. The gateway should also handle token refresh, retry with backoff for REQUEST_LIMIT_EXCEEDED (a 403 response from Salesforce) and circuit breaking. It is an additional hop, so it adds latency and an extra system to operate. Salesforce security still applies: the integration user's profile, permission sets and sharing decide what can be read.
Code / config example:
Policy chain at the gateway (example)
1. Client ID enforcement / OAuth token validation
2. Rate limiting: 100 requests / 60 s per client
3. IP allowlist for partner traffic
4. Request schema validation (JSON schema)
5. Forward to https://<MyDomain>.my.salesforce.com/services/data/vXX.X/...