---
schema_version: "1"
id: 2e26ab0f6d65fc6ba5578687d80dd739fc78483a50e4aab8789870715916c49b
title: Adding a Mule Gateway API Instance
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/api-manager/latest/create-instance-task-mule.md
canonical_url: https://docs.mulesoft.com/api-manager/latest/create-instance-task-mule
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d295c5dd6faee5b31acb01a3962e19c99105a930df251598a926d12596c5d47f
description: MuleSoft Documentation Site
release: 2.x
latest: true
---
---
product: API Manager
version: 2.x
is-latest-version: true
---

# Adding a Mule Gateway API Instance

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

After you have created an API using Design Center or any other application, you can then manage that
API in API Manager by adding an API instance. API instances remain under management until you delete
them.

Use Mule Gateway if you have APIs on Mule Runtime that need an API gateway to manage, observe, and
secure your APIs.

There are three options for adding an API instance:

- [**Add a new API:**](#add-api) Select this option to add a completely new instance of an API.

- [**Promote API from environment:**](#promote-api) Select this option if you have an API instance
  in a different environment, for instance the sandbox environment, and you want to promote it to
  the current or production environment.

- [**Import API from zip file:**](#import-api) Select this option if you have exported an API
  instance from a different Anypoint Platform instance.

When you are promoting or importing an API instance, you do not have options to alter the
configuration. However, when you add a new API instance, you need to the downstream and the upstream
configuration settings.

The following diagram shows the relationship of the upstream and downstream configurations settings
to your upstream service and the downstream consumer application. In this configuration, the
downstream service is the service making API requests that are completed by the upstream service.
These terms represent the direction of dependency, not the direction of information. A downstream
service could make a `POST` request where it provides information to the upstream service. However,
the downstream service is still dependent on the upstream service to complete the request.

![The API instance is deployed on a gateway between the upstream and downstream configuration](/mulesoft/current/en-us/api-manager/latest/_images/api-upstream-downstream-config.png)

## Add a New API

1.  Navigate to **Anypoint Platform** > **API Manager**.

2.  In **API Administration**, click **Add** and select **Add new API**.

3.  Select **Mule Gateway**.

4.  Select the **Proxy type** from the following options:

    Connect to existing application (basic endpoint)

    Use this option to directly interact with a Mule runtime Engine (Mule) application when your
    application is configured with API gateway autodiscovery. See
    [API Autodiscovery](https://docs.mulesoft.com/mule-gateway/mule-gateway-autodiscovery-overview) for more
    information.

    Select the **Mule version**.

    Deploy a proxy application

    Use this option to interact by proxy with an application, either because it is a Mule
    application not configured with API gateway autodiscovery or because it is not a Mule
    application. See [Configure Proxies for your APIs](https://docs.mulesoft.com/api-manager/latest/api-proxy-landing-page) for more information.

5.  If you selected to deploy a proxy application, select the **Target type** from the following
    options:

    - **CloudHub 2.0**: Select this option if you want to use the Mule runtime hosted by MuleSoft in
      a container-based cloud infrastructure. The CloudHub 2.0 proxy includes a CPU with 0.1 vCores
      by default.

      1.  Select a space.

          To learn more about spaces, see [Shared Spaces](https://docs.mulesoft.com/cloudhub-2/ch2-shared-space-about)
          and [Private Spaces](https://docs.mulesoft.com/cloudhub-2/ch2-private-space-about).

      2.  In **Runtime version**:

          1.  Select the **Runtime Channel**.

          2.  Select the **Version** for Mule runtime.

          3.  Select the **Java version**.

      3.  Enter a **Proxy app name**.

    - **CloudHub**: Select this option if you want to use the Mule runtime hosted on the cloud by
      MuleSoft. The CloudHub proxy includes a CPU with 0.1 vCores and a memory of 500 MB, by
      default.

      1.  In **Runtime version**:

          1.  Select the **Runtime Channel**.

          2.  Select the **Version** for Mule runtime.

          3.  Select the **Java version**.

      2.  Enter a **Proxy app name**.

    - **Hybrid:** Select this option if you want to use a Mule runtime instance running on an
      on-premises server that is registered in Runtime Manager.

      See [Register a server in Runtime Manager](https://docs.mulesoft.com/runtime-manager/servers-create) for more
      information.

      1.  Select a target from the list or click **Add server**.

      2.  Enter a **Proxy app name**.

    - **Self-managed Server:** Select this option if you want to create a JAR file to deploy an API
      proxy to a Mule runtime instance running on an on-premises server that is not registered in
      Runtime Manager. For more information, see
      [On-Premises Mule Runtime Deployment Model](https://docs.mulesoft.com/on-premises/latest/mule-deployment-model).

Deploying an API proxy to a self-managed server in API Manager doesn’t deploy the proxy to your
on-premises server. After you deploy the proxy in API Manager, deploy the proxy to your on-premises
server: . [Download your new API proxy JAR file](https://docs.mulesoft.com/api-manager/latest/download-proxy-task). .
[Deploy the JAR file to your on-premises server](https://docs.mulesoft.com/mule-runtime/latest/deploy-on-premises).

- **Runtime Fabric:** Select Runtime Fabric if you want to deploy API Proxies to a Mule runtime
  engine that is managed on Runtime Fabric. See
  [Deploying API Proxies to Runtime Fabric](https://docs.mulesoft.com/runtime-fabric/latest/proxy-deploy-runtime-fabric)
  for more information.

  1.  Select a target from the list.

  2.  In **Runtime version**:

      1.  Select the **Runtime Channel**.

      2.  Select the **Version** for Mule runtime.

      3.  Select the **Java version**.

  3.  Enter a **Proxy app name**.

      1.  Select an API from the following options:

- Click **Select API from Exchange** if you have an API shared with you through Exchange that you
  want to manage.

  1.  Click the API from the list under **Select API**. You can search for a specific API if needed.

  2.  Update the **Asset type**, **API version**, and **Asset version** if you are not using the
      latest version.

      For more information about versions in Exchange, see
      [Asset Versions](https://docs.mulesoft.com/exchange/asset-versions).

  3.  If you chose a **RAML/OAS** asset type, view the **Conformance Status** of the API to ensure
      the API is conformant. If the **Conformance Status** is nonconformant, after deployment, view
      the **Governance Report** to find and fix the conformance issues. For more information about
      the **Governance Report**, see [Governing API Instances](https://docs.mulesoft.com/api-manager/latest/govern-api-instances).

- Click **Create new API**:

  1.  Enter a **Name** for the new API asset.

  2.  Select the **Asset type** from the following options:

      - **REST API:** Select this option if you have a RAML or OAS API definition file you want to
        include for your asset.

        Upload either a RAML or OAS file for your REST API. Versions 2.0.0 and later are the
        recommended versions for OAS or RAML specs, because these versions add native OAS support.
        If you upload an OAS API specification to an API proxy version 1.0 or earlier, your API
        specification is translated to RAML.

      - **HTTP API:** Select this option if you do not have an API definition file you want to
        include for your asset. For WebSocket APIs, select HTTP and then choose the WebSocket
        subtype when selecting the API from Exchange. WebSocket instances can use HTTP or AsyncAPI
        assets from Exchange.

      - **SOAP API:** Select this option if you have a WSDL API definition file or an external link
        to the file.

        Upload a WSDL file for your SOAP API or add the link to the file.

      - **GraphQL API:** Select this option if you have a GraphQL schema definition file you want to
        include for your asset.

        Upload the GraphQL schema definition for your GraphQL API.

  3.  Update the **Asset type**, **API version**, and **Asset version** if you are not using the
      latest version.

      For more information about versions in Exchange, see
      [Asset Versions](https://docs.mulesoft.com/exchange/asset-versions).

  4.  If you chose a **RAML/OAS** asset type, view the **Conformance Status** of the API to ensure
      the API is conformant. If the **Conformance Status** is nonconformant, after deployment, view
      the **Governance Report** to find and fix the conformance issues. For more information about
      the **Governance Report**, see [Governing API Instances](https://docs.mulesoft.com/api-manager/latest/govern-api-instances).

      1.  Click **Next**.

      2.  Configure the downstream configuration settings relevant to your proxy type:

          Connect to existing application (basic endpoint)

          <table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Field Name</th><th>Description</th><th>Required</th><th>Notes</th></tr></thead><tbody><tr><td><p><strong>Instance label</strong></p></td><td><p>Specifies a label for the API.</p></td><td><p>No</p></td><td><p>If you have multiple managed instances of the same API, add a label to differentiate each instance from the others.</p></td></tr><tr><td><p><strong>Advanced Options</strong></p></td><td></td><td></td><td></td></tr><tr><td><p><strong>Consumer endpoint</strong></p></td><td><p>Specifies a proxy application’s address for consumers to use for sending requests.</p></td><td><p>No</p></td><td></td></tr><tr><td><p><strong>Client provider</strong></p></td><td><p>Specifies a client provider for the API.</p></td><td><p>Yes</p></td><td><p>Anypoint Platform acts as the client provider by default. To configure an external client provider, see <a href="https://docs.mulesoft.com/access-management/managing-api-clients">Client Providers</a>.</p></td></tr><tr><td><p><strong>Manual Approval</strong></p></td><td><p>Enables manual approval for API Requests.</p></td><td><p>No</p></td><td><p>After submitting the instance, you must go to <strong>Contracts</strong> to approve or revoke the request.</p></td></tr></tbody></table>

          Deploy a proxy application

          <table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Field Name</th><th>Description</th><th>Required</th><th>Notes</th></tr></thead><tbody><tr><td><p><strong>Protocol</strong></p></td><td><p>Specifies whether to use HTTP or HTTPS for the validations.</p></td><td><p>Yes</p></td><td><p>If you select HTTPS, specify a TLS context for inbound traffic.</p></td></tr><tr><td><p><strong>Inbound TLS</strong></p></td><td><p>Specifies the TLS context to secure inbound traffic.</p></td><td><p>No</p></td><td><p>If you can’t see a context, ensure that you have the correct permissions.</p></td></tr><tr><td><p><strong>Port</strong></p></td><td><p>Specifies the number to use if the displayed port is incorrect.</p></td><td><p>Yes</p></td><td></td></tr><tr><td><p><strong>Base path</strong></p></td><td><p>Specifies the URL prefix for all API paths, relative to the host root. It must start and end with a leading slash <code>/</code>. If the final slash isn’t provided, the system adds it automatically.</p></td><td><p>Yes</p></td><td></td></tr><tr><td><p><strong>Instance label</strong></p></td><td><p>Specifies a label for the API.</p></td><td><p>No</p></td><td><p>If you have multiple managed instances of the same API, add a label to differentiate each instance from the others.</p></td></tr><tr><td><p><strong>Advanced Options</strong></p></td><td></td><td></td><td></td></tr><tr><td><p><strong>Consumer endpoint</strong></p></td><td><p>Specifies a proxy application’s address for consumers to use for sending requests.</p></td><td><p>No</p></td><td></td></tr><tr><td><p><strong>Client provider</strong></p></td><td><p>Specifies a client provider for the API.</p></td><td><p>Yes</p></td><td><p>Anypoint Platform acts as the client provider by default. To configure an external client provider, see <a href="https://docs.mulesoft.com/access-management/managing-api-clients">Client Providers</a>.</p></td></tr><tr><td><p><strong>Request timeout</strong></p></td><td><p>Specifies the duration after which a request times out.</p></td><td><p>No</p></td><td></td></tr><tr><td><p><strong>Proxy Version</strong></p></td><td><p>Specifies the version of the proxy to use for the endpoint.</p></td><td><p>No</p></td><td></td></tr><tr><td><p><strong>Service Name</strong></p></td><td><p>Name of your WSDL service.</p></td><td><p>Yes</p></td><td><p>Only avaliable for WSDL APIs.</p></td></tr><tr><td><p><strong>Service Port</strong></p></td><td><p>Port for your WSDL your service.</p></td><td><p>Yes</p></td><td><p>Only avaliable for WSDL APIs.</p></td></tr><tr><td><p><strong>Service Namespace</strong></p></td><td><p>Namespace of your WSDL service.</p></td><td><p>Yes</p></td><td><p>Only avaliable for WSDL APIs.</p></td></tr><tr><td><p><strong>Enable Console</strong></p></td><td><p>Specifies whether you can expose and test your API specification.</p></td><td><p>No</p></td><td><p>You can specify a different path in <strong>Console Path</strong>, for example, <code>/spec/*</code>. Only available if you have an attached API definition.</p></td></tr><tr><td><p><strong>Validations</strong></p></td><td><p>Specifies whether to validate inbound requests against a provided specification.</p></td><td><p>No</p></td><td><p>Only available if you have an attached API definition.</p></td></tr><tr><td><p><strong>Strict validations (optional)</strong></p></td><td><p>Specifies whether to validate inbound requests against query parameters.</p></td><td><p>No</p></td><td><p>Only available if you have an attached API definition.</p></td></tr><tr><td><p><strong>User Domain</strong></p></td><td><p>Specifies whether to use an API gateway domain.</p></td><td><p>No</p></td><td><p>If you chose <strong>Hybrid</strong> as the proxy deployment target previously in the configuration, ensure that you select this option.</p></td></tr></tbody></table>

      3.  Click **Next**.

      4.  Configure the upstream configuration settings relevant to your proxy type:

          Connect to existing application (basic endpoint)

          <table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Field Name</th><th>Description</th><th>Required</th><th>Notes</th></tr></thead><tbody><tr><td><p><strong>Upstream URL</strong></p></td><td><p>The URL to access for the proxy or the API.</p></td><td><p>No</p></td><td><p>For example, you can use the URL of your API asset in Exchange.</p></td></tr></tbody></table>

          Deploy a proxy application

          <table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Field Name</th><th>Description</th><th>Required</th><th>Notes</th></tr></thead><tbody><tr><td><p><strong>Upstream URL</strong></p></td><td><p>The URL to access for the proxy or the API.</p></td><td><p>Yes</p></td><td><p>For example, you can use the URL of your API asset in Exchange.</p></td></tr><tr><td><p><strong>Outbound TLS</strong></p></td><td><p>Specifies the TLS context to secure outbound traffic.</p></td><td><p>No</p></td><td><p>If you can’t see a context, ensure that you have the correct permissions.</p></td></tr></tbody></table>

      5.  Click **Next**.

      6.  Review your selections and edit them if necessary.

      7.  If you are ready to deploy, click **Save & Deploy**. Otherwise, you can select **Save**,
          to save the instance and deploy it at a later time.

          \== Create New API Asset

> [!NOTE] This feature is only available on GovCloud environments. If you want to create an API
> asset in other environments, refer to
> [exchange::to-create-an-asset.adoc#create-an-api-asset](https://docs.mulesoft.com/exchange/to-create-an-asset#create-an-api-asset)

An API asset specifies an interface completely, including its functions, descriptions, how to handle
return codes, and dependencies.

Creating an asset sets the asset type, which cannot be changed. All versions of an asset always have
the same type.

To create an API asset:

1.  In API Manager, click **Add API**.

2.  From the dropdown list, select **Create new API asset**

3.  Enter a name for the asset.

4.  Select the asset type from the drop-down list:

    - REST API - RAML: Provide a RAML API specification file. RAML specifications must be a RAML
      file (.raml).

    - REST API - OAS: Provide an OAS API specification file. OAS specifications can be either a YAML
      (.yaml) or JSON (.json) file. Exchange supports OAS 2.0, OAS 3.0, and OAS 3.1 specifications.

    - SOAP API - WSDL: Provide a WSDL API specification file. SOAP specifications file can be either
      a WSDL (.wsdl) or XML (.xml) file.

    - AsyncAPI: Provide an AsyncAPI specification file in a YAML (.yaml) or JSON (.json) file.

    - AsyncAPI with Avro schemas: Provide an Avro fragment in an AVSC (.avsc) file.

    - API Spec Fragment - RAML: Provide an API Fragment RAML specification file. Fragment
      specifications must be a RAML file (.raml).

    - API Spec Fragment - JSON: Provide an API Fragment JSON specification (.json) file.

    - API Spec Fragment - OpenAPI Specification (OAS): Provide an API Fragment OpenAPI specification
      file either JSON or YAML.

    - HTTP API: This asset does not require a file. This asset type provides an API endpoint that is
      defined by API Manager.

5.  For assets that require a file:

    1.  Click **Choose File** to locate the API specification file.

    2.  Select the main file of the API.  
        If the file is a ZIP, the selected main file must be in the root directory of the ZIP file.
        If the file is not a ZIP or if the file is a ZIP file with only one main file, then the main
        file is selected automatically.

6.  If you want to edit the **GroupId**, **AssetId**, **Version**, and **API version** (GAV), click
    **Advanced**.  
    Exchange generates the group ID, asset ID, and version (GAV) for you, and you can change these
    values as needed. You can change an API’s asset version and version separately. Use the advanced
    settings to change the asset version.

7.  Choose an option for **Lifecycle state**. The default is Stable.

8.  Click **Publish**.

## Promote an API Instance from Another Environment

1.  Navigate to **Anypoint Platform** > **API Manager**.

2.  In **API Administration**, click **Add API** and select **Promote API from environment**.

3.  Select the **Source Environment**.

4.  Select the **API** by entering the name of the API into the search field.

5.  Select the **API Version**.

6.  Select the **API instance label**.

7.  Optionally, uncheck any of the **Include in Promotion** options you want to exclude.

8.  Click **Promote**.

9.  Review and update the Runtime & Endpoint Configuration details as needed and click **Save**.

## Import API from Zip File

1.  Navigate to **Anypoint Platform** > **API Manager**.

2.  From **API Administration**, click **Add API** and select **Import API from zip file**.

3.  Click **Choose file** and select your API instance configuration zip file.

4.  Click **Next**.

5.  Review and update the API Configuration details as needed and click **Save**.

## Notes

- Although OpenAPI Specification (OAS) 3.0 and 3.1 are supported, the callback feature is not. To
  work around this issue, either handle the callback outside of the Mule runtime engine domain or
  use an OAS 3.0 or 3.1 specification that does not use callbacks.
