---
schema_version: "1"
id: 3158449947da785ddaec36b88ae049c30465e8dfa34f7bc199fac90231bc7bf5
title: "Migrating API Gateways: Autodiscovery"
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mule-runtime/4.3/migration-api-gateways-autodiscovery.md
canonical_url: https://docs.mulesoft.com/mule-runtime/4.3/migration-api-gateways-autodiscovery
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 606b81d3d95d190e4e712055ea9a9614c072669420c9b6269feb93eb2498da7d
description: MuleSoft Documentation Site
release: "4.3"
latest: false
---
---
product: Mule Runtime
version: 4.3
---

# Migrating API Gateways: Autodiscovery

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

The Autodiscovery element was updated after Mule 4 release.

- APIs are referenced by an ID instead of a name and version.

- Creation of APIs from the runtime is no longer possible.

Simple Mule app with an HTTP listener and an Autodiscovery element defined:

Mule 3 Example: All Configurable Attributes

```xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:api-platform-gw="http://www.mulesoft.org/schema/mule/api-platform-gw"
      xmlns:http="http://www.mulesoft.org/schema/mule/http"
      xsi:schemaLocation="
       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
       http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
       http://www.mulesoft.org/schema/mule/api-platform-gw http://www.mulesoft.org/schema/mule/api-platform-gw/current/mule-api-platform-gw.xsd">

    <api-platform-gw:api id="apiId" create="true" apiName="name" version="1.0.0" flowRef="flow_api">
        <api-platform-gw:description>This is a test API</api-platform-gw:description>
        <api-platform-gw:tag>tag1</api-platform-gw:tag>
        <api-platform-gw:tag>tag2</api-platform-gw:tag>
    </api-platform-gw:api>

    <http:listener-config name="httpConfig" host="localhost" port="${port}" />

    <flow name="flow_api">
        <http:listener config-ref="httpConfig" path="api" />
        <logger message="Executing empty" level="INFO"/>
    </flow>

</mule>
```

Mule 4 Example: All Configurable Attributes

```xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:http="http://www.mulesoft.org/schema/mule/http"
      xmlns:api-gateway="http://www.mulesoft.org/schema/mule/api-gateway"
      xsi:schemaLocation="
       http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
       http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
       http://www.mulesoft.org/schema/mule/api-gateway http://www.mulesoft.org/schema/mule/api-gateway/current/mule-api-gateway.xsd">

    <api-gateway:autodiscovery apiId="1" flowRef="flow_api" />

    <http:listener-config name="httpConfig" basePath="api">
        <http:listener-connection host="localhost" port="${port}"/>
    </http:listener-config>

    <flow name="flow_api">
        <http:listener config-ref="httpConfig" path="api" />
        <logger message="Executing empty" level="INFO"/>
    </flow>

</mule>
```

## See Also

[Migrating API Gateways](https://docs.mulesoft.com/mule-runtime/4.3/migration-api-gateways)

[Migrating API Gateways: Policies](https://docs.mulesoft.com/mule-runtime/4.3/migration-api-gateways-policies)

[Migrating API Gateways: Mule Runtime Configuration](https://docs.mulesoft.com/mule-runtime/4.3/migration-api-gateways-runtime-config)
