API-led integration architecture
How system, process and experience APIs fit together around Salesforce and other systems, with error handling, idempotency and monitoring, and where MuleSoft fits.

API-led integration organises integrations into three layers. System APIs wrap each system of record behind a stable contract. Process APIs hold business logic and orchestrate across systems. Experience APIs shape data for a particular consumer, such as a mobile app, a partner portal or an AI agent. The aim is that a change in one system or channel touches one layer, not every integration.
This is a reference design. We validate the systems, APIs, limits and licences for each implementation, and GeekMidst can design and implement it through Salesforce integration services or MuleSoft integration services.
Business context
Point-to-point integrations are often how estates start: Salesforce calls the ERP, the ERP calls the marketing platform, and a script copies files overnight. Each link is simple, but the total grows quickly, credentials spread, and nobody can see where an order went missing. Middleware with layered APIs adds a platform to run, but centralises mapping, retries, security and monitoring. MuleSoft, with its Anypoint Platform for APIs and integration, is one option; other middleware and iPaaS products can implement the same pattern.
API-led integration reference architecture
Reference architecture: a reusable pattern, not a live client integration
Select a component to see what it is responsible for and how data moves to and from it.
Components and data flows (text version)
| Component | Type | Responsibility |
|---|---|---|
| Web and mobile appscustomer channels | Channel or touchpoint | Customer-facing apps that need order, account or case data in a channel-friendly shape. |
| Partner portalsexternal users | Channel or touchpoint | Partner and customer portals that need a narrow, secured view of data. |
| AI agents and MCP clientstool consumers | AI and agents | AI clients that use business capabilities as tools through an MCP server. |
| API gateway and policiesauth, rate limits | Identity, policy and governance | Validates OAuth tokens, applies rate limits and policies, and records every call before it reaches an API. |
| Web and mobile APIexperience | Integration layer | Shapes data for app screens and hides back-end structure. |
| Partner APIexperience | Integration layer | Exposes only the records and fields partners may see. |
| MCP serverexperience for AI | AI and agents | Presents selected APIs as MCP tools. MuleSoft MCP Bridge, GA in August 2026, is one way to do this. |
| Process APIsorchestration and rules | Integration layer | Business logic such as order-to-cash or customer onboarding, calling several system APIs in order. |
| Event broker or queueasynchronous | Integration layer | Decouples producers and consumers so slow systems do not block fast ones. |
| Error queue and replaydead-letter | Integration layer | Holds failed messages with context so they can be fixed and replayed. |
| Monitoring and tracingcorrelation IDs | Identity, policy and governance | Collects logs, metrics and traces from every layer, with alerts to named owners. |
| Salesforce system APIREST, Bulk, Pub/Sub | Integration layer | Wraps Salesforce objects and events behind a stable contract, using a least-privilege integration user. |
| ERP system APIorders and invoices | Integration layer | Wraps the ERP's interfaces and hides its quirks from process APIs. |
| Marketing system APIMarketing Cloud or Braze | Integration layer | Wraps the marketing platform's APIs and respects its rate limits. |
| SalesforceCRM and service | Salesforce product | System of record for accounts, contacts, opportunities and cases. |
| ERP and financeorders, invoices | External or custom system | System of record for orders, invoices and payments. |
| Marketing platformmessaging and journeys | Engagement platform | System of record for messaging, subscriptions and engagement. |
Data flows
- Web and mobile apps → API gateway and policies: app requests. Calls carry OAuth tokens. Invalid tokens are refused at the gateway.
- Partner portals → API gateway and policies: portal requests. Partner calls are limited to partner scopes and rate limits.
- AI agents and MCP clients → API gateway and policies: tool calls. AI tool calls pass the same gateway policies as any other consumer.
- API gateway and policies → Web and mobile API: routed calls. Only authenticated, policy-compliant calls are routed.
- API gateway and policies → Partner API: routed calls. Partner traffic goes only to the partner API.
- API gateway and policies → MCP server: MCP requests. MCP requests are authenticated like other calls; write tools need approval.
- Web and mobile API → Process APIs: business requests. Experience APIs call process APIs, never systems directly.
- Partner API → Process APIs: business requests. The same process logic serves every channel.
- MCP server → Process APIs: tool execution. Tools map to process APIs with strict input schemas.
- Process APIs → Event broker or queue: publish events. Long-running or non-urgent work is queued rather than called synchronously.
- Event broker or queue → Error queue and replay: failed messages. Messages that exhaust retries move to the error queue with the reason.
- Error queue and replay → Monitoring and tracing: alerts. Error queue depth and age raise alerts.
- Process APIs → Salesforce system API: CRM calls. Idempotent calls with an external ID, so a retry updates instead of duplicating.
- Process APIs → ERP system API: ERP calls. Retries with back-off for timeouts and 5xx errors; no retry for validation errors.
- Event broker or queue → Marketing system API: marketing updates. Consumed asynchronously and throttled to the platform's rate limits.
- Salesforce system API → Salesforce: Salesforce APIs. REST or Bulk API writes; Change Data Capture via Pub/Sub API for changes out.
- ERP system API → ERP and finance: ERP interfaces. The ERP's own APIs or files, wrapped once.
- Marketing system API → Marketing platform: platform APIs. Marketing platform APIs; 429 responses are backed off using rate-limit headers.
- Salesforce system API → Event broker or queue: change events. The Salesforce system API subscribes to Change Data Capture over the Pub/Sub API and publishes changes to the broker. It stores the replay ID and replays within the retention window after an outage.
Component responsibilities
| Layer or component | Responsible for | Design note |
|---|---|---|
| Experience APIs | Shaping data for one consumer | Change freely without touching systems |
| Process APIs | Business rules and orchestration | Own the order of steps and compensation on failure |
| System APIs | Stable contracts over each system | One per system, owned by that system's team |
| API gateway | Authentication, rate limits, policies | Same rules for apps, partners and AI clients |
| Event broker | Asynchronous delivery | Use for non-urgent or high-volume work |
| Error queue | Failed messages and replay | Every message has an owner and a reason |
| Monitoring | Logs, metrics, traces, alerts | Correlation ID across all layers |
Data flow, step by step
- A consumer calls an experience API through the gateway, which checks the token and limits.
- The experience API calls a process API, for example "place order".
- The process API orchestrates: it validates the request, calls the ERP and Salesforce system APIs, and publishes an event for the marketing update.
- System APIs call the systems with idempotent requests and their own credentials.
- Asynchronous work is queued and consumed at a rate the target can accept.
- Changes in Salesforce flow back through Change Data Capture, read over the Pub/Sub API. High-volume events are retained for 72 hours, so subscribers must recover within that window or reconcile.
- Failures go to the error queue and raise alerts with the correlation ID. Our order-to-cash with MuleSoft solution shows a worked design.
Error handling and idempotency
Retry only what can succeed on retry: timeouts, rate-limit responses and server errors, with exponential back-off and a cap. Do not retry validation errors; send them to the error queue for a person to fix. Make every write idempotent, for example by upserting on an external ID or passing an idempotency key, so a retry never creates a duplicate. Our integration error handling checklist goes further.
Trust boundaries and authentication
The gateway is the boundary for consumers. Each system API holds its own credential to its system, with least privilege. On Salesforce, use External Client Apps for inbound integrations, since connected apps support ends in Summer '27, and Named Credentials for outbound callouts. AI clients are consumers like any other; see the MCP security architecture.
Failure scenarios and how to handle them
| Failure | Effect | How to handle it |
|---|---|---|
| Target system down | Calls fail | Queue and retry with back-off; alert after a threshold |
| Rate limit reached | 429 responses | Throttle consumers; honour retry headers |
| Duplicate delivery | Duplicate records | Idempotent upserts and keys |
| Validation error | Message cannot succeed | Error queue with reason; no automatic retry |
| Partial orchestration failure | Inconsistent systems | Compensating steps owned by the process API |
| Subscriber misses events | Data drift | Replay within retention, then reconcile |
Operational monitoring
Track request rates, error rates and latency per API, error queue depth and age, retry counts and end-to-end traces by correlation ID. Give each API and queue a named owner. Check Salesforce API consumption against your org's allocation in Salesforce documentation rather than assuming figures.
Alternative approaches and trade-offs
Point-to-point suits one or two stable links; compare in middleware vs point-to-point APIs. Event-driven designs decouple systems but need careful ordering and replay; see platform events for decoupled integrations. Low-code iPaaS tools such as MuleSoft Composer suit simple flows. Salesforce Connect shows external data without copying it, at the cost of depending on the external system.
Implementation checklist
- 01
Inventory systems and flows
Owners, volumes, latency needs and data ownership
- 02
Define system APIs
One stable contract per system of record
- 03
Define process APIs
Business steps, order and compensation
- 04
Define experience APIs
Per consumer, including any MCP server
- 05
Design error handling
Retry rules, idempotency and the error queue
- 06
Secure each layer
Gateway policies, scoped credentials, External Client Apps
- 07
Set up monitoring
Logs, traces, alerts and named owners
- 08
Test failure paths
Outages, rate limits and replay before go-live
Related services and solutions
Salesforce integration services
Design and build of integrations
→MuleSoft integration services
APIs and integration on MuleSoft
→Integration solutions
Solution designs for common flows
→MuleSoft and MCP
Exposing APIs to AI clients
→Salesforce CRM architecture
The CRM side of the estate
→Salesforce and Braze architecture
A worked integration pattern
→Questions we hear
Do we need MuleSoft for API-led integration?
Is three layers always right?
How should AI agents use our APIs?
Is this from a client project?
Sources
- https://www.mulesoft.com/
- https://docs.mulesoft.com/mcp-connector/latest/
- https://blogs.mulesoft.com/news/mulesoft-26-mid-year-release-create-ai-experiences/
- https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/cdc_subscribe.htm
- https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_durability.htm
- https://www.braze.com/docs/api/api_limits
Plan your integration architecture
Tell us which systems need to talk to each other. We can propose a layered design with error handling, security and monitoring.




