Contact Free trial Login

Anypoint Exchange

Home to the complete listing of connectors, templates, examples and APIs.
Discover and use proven assets built by the MuleSoft ecosystem, or add assets to a private
tenant of Anypoint Exchange for collaboration and sharing of internal best practices.

API Gateway Sample RAML Proxy

API Gateway Sample RAML Proxy

(0 reviews)

This proxy lets you offer to your customers capabilities that are not implemented in your API, without the need of adding a single line of code to it. In combination with API Policies and API Gateway, you can improve your security, enrich incoming messages, add troubleshooting features like logging, etc.

The proxy is a Mule application and as such, it can be only deployed to a Mule runtime.
Only the resources provided in your spec are the ones that will be handled and sent to the backend service.

Note: If your API is already a Mule based application, then instead of using a proxy, you can just include the autodiscovery capability to it.

What happens to a request that goes through the proxy?

  • The X-Forwarded-For header is included or updated.
  • All headers received are forwarded to the implementation API, except for the ones that mule includes (X-MULE-SESSION, X-MULE-ENCODING, etc).
  • All headers received from the implementation API are forwarded to the client.
  • Validation against your RAML (0.8/1.0) spec. This includes:

    • Headers
    • Uri parameters
    • Query parameters
    • Form parameters
    • Body (against JSON schema / XML schema / RAML type)
  • If your RAML spec specifies optional parameters with a default value, and the request does not provide that parameter, the proxy will add it.

Response status codeReason
504Gateway timeout
400Bad request (Validation result)
404Not found (The resource/method could not be found in the RAML spec)

What else do you gain by using this type of proxy?

  • This proxy includes the API Console to test your requests. By default, you can find it by hitting “:/console”
  • Users can leverage analytics information that is generated only if the API is tracked.You have the ability to apply API Gateway policies to it.


Log into Anypoint Platform to download this asset


Created by
MuleSoft Organization
Published onMay 15, 2018


VersionRuntime version