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.

Banner for the GeekMidst reference architecture “API-led integration architecture”, covering Business context and API-led integration reference…

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

Integration platform (MuleSoft or other)Systems of recordCONSUMERSGATEWAYEXPERIENCE APISPROCESS APISSYSTEM APISSYSTEMS OF RECORDWeb and mobile appscustomer channelsPartner portalsexternal usersAI agents and MCP clientstool consumersAPI gateway and policiesauth, rate limitsWeb and mobile APIexperiencePartner APIexperienceMCP serverexperience for AIProcess APIsorchestration and rulesEvent broker or queueasynchronousError queue and replaydead-letterMonitoring and tracingcorrelation IDsSalesforce system APIREST, Bulk, Pub/SubERP system APIorders and invoicesMarketing system APIMarketing Cloud or BrazeSalesforceCRM and serviceERP and financeorders, invoicesMarketing platformmessaging and journeysapp requestsportal requeststool callsrouted callsrouted callsMCP requestsbusiness requestsbusiness requeststool executionpublish eventsfailed messagesalertsCRM callsERP callsmarketing updatesSalesforce APIsERP interfacesplatform APIschange events
  • Salesforce product
  • Engagement platform
  • AI and agents
  • Integration layer
  • Identity, policy and governance
  • Channel or touchpoint
  • External or custom system
  • Integration platform (MuleSoft or other)
  • Systems of record
  • Dashed: asynchronous, optional or feedback
Diagram source (Mermaid)

Select a component to see what it is responsible for and how data moves to and from it.

Reference architecture. Middleware product, API contracts, limits and error handling are confirmed per implementation. MuleSoft is one option.
Components and data flows (text version)
ComponentTypeResponsibility
Web and mobile appscustomer channelsChannel or touchpointCustomer-facing apps that need order, account or case data in a channel-friendly shape.
Partner portalsexternal usersChannel or touchpointPartner and customer portals that need a narrow, secured view of data.
AI agents and MCP clientstool consumersAI and agentsAI clients that use business capabilities as tools through an MCP server.
API gateway and policiesauth, rate limitsIdentity, policy and governanceValidates OAuth tokens, applies rate limits and policies, and records every call before it reaches an API.
Web and mobile APIexperienceIntegration layerShapes data for app screens and hides back-end structure.
Partner APIexperienceIntegration layerExposes only the records and fields partners may see.
MCP serverexperience for AIAI and agentsPresents selected APIs as MCP tools. MuleSoft MCP Bridge, GA in August 2026, is one way to do this.
Process APIsorchestration and rulesIntegration layerBusiness logic such as order-to-cash or customer onboarding, calling several system APIs in order.
Event broker or queueasynchronousIntegration layerDecouples producers and consumers so slow systems do not block fast ones.
Error queue and replaydead-letterIntegration layerHolds failed messages with context so they can be fixed and replayed.
Monitoring and tracingcorrelation IDsIdentity, policy and governanceCollects logs, metrics and traces from every layer, with alerts to named owners.
Salesforce system APIREST, Bulk, Pub/SubIntegration layerWraps Salesforce objects and events behind a stable contract, using a least-privilege integration user.
ERP system APIorders and invoicesIntegration layerWraps the ERP's interfaces and hides its quirks from process APIs.
Marketing system APIMarketing Cloud or BrazeIntegration layerWraps the marketing platform's APIs and respects its rate limits.
SalesforceCRM and serviceSalesforce productSystem of record for accounts, contacts, opportunities and cases.
ERP and financeorders, invoicesExternal or custom systemSystem of record for orders, invoices and payments.
Marketing platformmessaging and journeysEngagement platformSystem of record for messaging, subscriptions and engagement.

Data flows

  1. Web and mobile apps → API gateway and policies: app requests. Calls carry OAuth tokens. Invalid tokens are refused at the gateway.
  2. Partner portals → API gateway and policies: portal requests. Partner calls are limited to partner scopes and rate limits.
  3. AI agents and MCP clients → API gateway and policies: tool calls. AI tool calls pass the same gateway policies as any other consumer.
  4. API gateway and policies → Web and mobile API: routed calls. Only authenticated, policy-compliant calls are routed.
  5. API gateway and policies → Partner API: routed calls. Partner traffic goes only to the partner API.
  6. API gateway and policies → MCP server: MCP requests. MCP requests are authenticated like other calls; write tools need approval.
  7. Web and mobile API → Process APIs: business requests. Experience APIs call process APIs, never systems directly.
  8. Partner API → Process APIs: business requests. The same process logic serves every channel.
  9. MCP server → Process APIs: tool execution. Tools map to process APIs with strict input schemas.
  10. Process APIs → Event broker or queue: publish events. Long-running or non-urgent work is queued rather than called synchronously.
  11. Event broker or queue → Error queue and replay: failed messages. Messages that exhaust retries move to the error queue with the reason.
  12. Error queue and replay → Monitoring and tracing: alerts. Error queue depth and age raise alerts.
  13. Process APIs → Salesforce system API: CRM calls. Idempotent calls with an external ID, so a retry updates instead of duplicating.
  14. Process APIs → ERP system API: ERP calls. Retries with back-off for timeouts and 5xx errors; no retry for validation errors.
  15. Event broker or queue → Marketing system API: marketing updates. Consumed asynchronously and throttled to the platform's rate limits.
  16. Salesforce system API → Salesforce: Salesforce APIs. REST or Bulk API writes; Change Data Capture via Pub/Sub API for changes out.
  17. ERP system API → ERP and finance: ERP interfaces. The ERP's own APIs or files, wrapped once.
  18. Marketing system API → Marketing platform: platform APIs. Marketing platform APIs; 429 responses are backed off using rate-limit headers.
  19. 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 componentResponsible forDesign note
Experience APIsShaping data for one consumerChange freely without touching systems
Process APIsBusiness rules and orchestrationOwn the order of steps and compensation on failure
System APIsStable contracts over each systemOne per system, owned by that system's team
API gatewayAuthentication, rate limits, policiesSame rules for apps, partners and AI clients
Event brokerAsynchronous deliveryUse for non-urgent or high-volume work
Error queueFailed messages and replayEvery message has an owner and a reason
MonitoringLogs, metrics, traces, alertsCorrelation ID across all layers

Data flow, step by step

  1. A consumer calls an experience API through the gateway, which checks the token and limits.
  2. The experience API calls a process API, for example "place order".
  3. The process API orchestrates: it validates the request, calls the ERP and Salesforce system APIs, and publishes an event for the marketing update.
  4. System APIs call the systems with idempotent requests and their own credentials.
  5. Asynchronous work is queued and consumed at a rate the target can accept.
  6. 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.
  7. 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

FailureEffectHow to handle it
Target system downCalls failQueue and retry with back-off; alert after a threshold
Rate limit reached429 responsesThrottle consumers; honour retry headers
Duplicate deliveryDuplicate recordsIdempotent upserts and keys
Validation errorMessage cannot succeedError queue with reason; no automatic retry
Partial orchestration failureInconsistent systemsCompensating steps owned by the process API
Subscriber misses eventsData driftReplay 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

  1. 01

    Inventory systems and flows

    Owners, volumes, latency needs and data ownership

  2. 02

    Define system APIs

    One stable contract per system of record

  3. 03

    Define process APIs

    Business steps, order and compensation

  4. 04

    Define experience APIs

    Per consumer, including any MCP server

  5. 05

    Design error handling

    Retry rules, idempotency and the error queue

  6. 06

    Secure each layer

    Gateway policies, scoped credentials, External Client Apps

  7. 07

    Set up monitoring

    Logs, traces, alerts and named owners

  8. 08

    Test failure paths

    Outages, rate limits and replay before go-live

Questions we hear

Do we need MuleSoft for API-led integration?
No. MuleSoft is one option. The pattern can be built on other middleware or iPaaS products.
Is three layers always right?
Not always. Small estates may combine process and experience APIs. Keep system APIs separate, since they protect you from changes in each system.
How should AI agents use our APIs?
Through an experience-layer MCP server behind the same gateway, with read-only tools first and approval for writes.
Is this from a client project?
No. It is a reference design that we validate for each implementation.

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.

Book a consultation →

Tell us what you are trying to fix.

Share your Salesforce setup, goals and constraints. A practitioner reads every message and replies with questions, first thoughts or an honest view of whether you need outside help at all.

Talk to a Salesforce Expert
Book a Consultation