---
title: "Mastering API Gateway Integration: Salesforce, Heroku, and MuleSoft Anypoint Flex Gateway"
description: "MuleSoft Anypoint Flex Gateway can run as a container app inside a Heroku Private Space and act as the single public ingress for internally routed Heroku APIs."
url: "https://swe.quest/articles/mastering-api-gateway-integration-salesforce-heroku-and-mulesoft-anypoint-flex-61e38a9ef91192f3"
canonical: "https://www.heroku.com/blog/mastering-api-integration-salesforce-heroku-mulesoft-anypoint-flex-gateway/"
source: "Heroku Engineering"
published: "2024-07-29"
difficulty: "medium"
kind: "How-to"
reading_minutes: 10
tags: ["api-design","cloud","identity-auth","deployment"]
---

# Mastering API Gateway Integration: Salesforce, Heroku, and MuleSoft Anypoint Flex Gateway

A post on [Heroku Engineering](https://swe.quest/sources/heroku.md), published 2024-07-29, 10 min read, How-to. Original: [https://www.heroku.com/blog/mastering-api-integration-salesforce-heroku-mulesoft-anypoint-flex-gateway/](https://www.heroku.com/blog/mastering-api-integration-salesforce-heroku-mulesoft-anypoint-flex-gateway/)

## Summary

MuleSoft Anypoint Flex Gateway can run as a container app inside a Heroku Private Space and act as the single public ingress for internally routed Heroku APIs. The walkthrough deploys an internal API with --internal-routing, imports its OpenAPI spec into Design Center and publishes it to Exchange, then generates registration.yaml via Runtime Manager. It deploys the gateway with Flex-specific config vars (dynamic port, idle timeouts, Envoy drain time and concurrency) and wires the internal URL as the upstream in API Manager. A Client ID Enforcement policy then demonstrates gateway-level authentication without application code changes.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [Cloud platforms](https://swe.quest/tags/cloud.md) (Infrastructure)
- [Identity & auth](https://swe.quest/tags/identity-auth.md) (Security)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)

## Prerequisites

- Heroku CLI basics ([easy posts on Developer tools](https://swe.quest/tags/developer-tools.md?difficulty=easy))
- API gateway concepts
- OpenAPI specifications

## Keywords

MuleSoft Anypoint Flex Gateway, Heroku Private Spaces, Anypoint API Manager, Envoy, OpenAPI, Salesforce

## Related posts

- [AppLink Fundamentals II: Advanced AppLink Integrations – Automation & AI](https://swe.quest/articles/applink-fundamentals-ii-advanced-applink-integrations-automation-ai-08ffd36a5cc535fb.md): Heroku Engineering · 2025-07-30 · Medium · 4 min read · API design, Identity & auth, JavaScript, Cloud platforms
  Heroku AppLink turns an OpenAPI spec with Salesforce-specific x-sfdc extensions into generated Apex classes, Flow External Service actions, Agentforce Agent Actions, and Connected App/Permission Set configuration via \`heroku salesforce:publish\`.
- [AppLink Fundamentals III: Building with AppLink – Development Flow and Language Choices](https://swe.quest/articles/applink-fundamentals-iii-building-with-applink-development-flow-and-language-dfc29aba65ba6f73.md): Heroku Engineering · 2025-07-31 · Medium · 8 min read · API design, AI agents, CI/CD, Cloud platforms
  Heroku AppLink lets Salesforce extensions be built in Node.js, Python, Java and other languages, and the development loop centers on local testing, OpenAPI contract management and disposable scratch orgs.
- [AppLink Fundamentals I: AppLink Integration Patterns – Connecting Salesforce to Heroku Applications](https://swe.quest/articles/applink-fundamentals-i-applink-integration-patterns-connecting-salesforce-to-979e67d1f6466838.md): Heroku Engineering · 2025-07-29 · Medium · 11 min read · Identity & auth, API design, JavaScript, Cloud platforms
  Heroku AppLink offers two core integration patterns between Salesforce and Heroku apps.
- [Heroku AppLink: Extend Salesforce with Any Programming Language](https://swe.quest/articles/heroku-applink-extend-salesforce-with-any-programming-language-781061fca4332dc5.md): Heroku Engineering · 2025-07-17 · Easy · 7 min read · Cloud platforms, Identity & auth, API design
  Heroku AppLink, now generally available from the Salesforce Setup menu, is a free Heroku add-on that lets code in almost any language be deployed on Heroku and invoked from Salesforce Flow, Apex and Agentforce.
- [Using GitHub Actions with Heroku Flow for additional Security Control](https://swe.quest/articles/using-github-actions-with-heroku-flow-for-additional-security-control-fea72ed977a6f5e4.md): Heroku Engineering · 2025-03-27 · Medium · 7 min read · CI/CD, Deployment, Security, Cloud platforms
  Because GitHub Orgs can't allowlist Heroku IP ranges, Heroku offers a sample pattern: a self-hosted GitHub Actions runner deployed as a Docker app in a Heroku Private Space with static outbound IPs, plus a Heroku Flow Action.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
