Promoting API Schemas | MuleSoft Documentation
# Promoting API Schemas
As you develop and configure an API schema, you can promote it to the next environment toward production and add it to that environment’s unified schema. Note that you’re promoting the schema configurations only, not the actual underlying source REST APIs.
Promotion enables you to configure an API schema in one environment without repeating that configuration in subsequent environments. Use promotion to move your schema configurations from development to staging and from staging to production.
The steps you take to promote an API through the production cycle vary depending on your needs. For example, imagine that you add and configure an Orders API in your development environment that you now want to promote to staging. The possible promotion scenarios are as follows:
Development Orders API Version | Staging Orders API Version | Promotion Action | Promotion Outcome Version  
---|---|---|---  
Anypoint DataGraph promotes the API schema and any of its configuration. You configure the URL and authentication method.  
Anypoint DataGraph automatically updates the asset version of the existing API schema. You configure the URL and authentication method.  
Anypoint DataGraph updates any customizations to the asset version.  
Anypoint DataGraph adds both API versions to the target environment, where they coexist. You configure the URL and authentication method for v4.0.0. | v3.1.0, v4.0.0  
## Promote an API to Another Environment
You can promote API schemas to any environment to which you are permitted access.
Although your APIs must be published in Exchange, they do not need to be Mule applications or be running on Mule runtime engine or in CloudHub to be added to the unified schema.
The schema you promote must not be in conflict with the unified schema in the target environment. If conflicts exist, you must instead manually add the API and resolve those conflicts as you would when adding an API.
You must have the Contribute or Admin permission.
Supported authentication methods to access your API from Anypoint DataGraph are listed in the following procedure. Any other authentication methods, such as short-lived token methods, are not supported. See Supported Authentication Methods for more information.  
---  
To promote an API:
  1. Click **List of APIs added** and select the API that you want to promote.
  2. Click **Promote API schema**.
  3. From the **Target environment** list, select the target environment for promotion.
  4. Click **Next: Configure URL**.
  5. Depending on your promotion scenario, optionally choose one of the following configuration options:
     * If your API is managed by API Manager or if you have added the API’s instances in Exchange, select **Get an existing URL from Anypoint Platform**.
     * If you prefer to provide your own implementation URL, select **Add a new URL** or click **Use the URL in API specification**.
  6. Click **Next: Provide Authentication**.
  7. On the **Provide authentication** page, select the type of authentication on the GET endpoints for the API that you want to add, allowing Anypoint DataGraph to make requests to your API when queried:
     * **No Auth** : Use if your API is public.
     * **Basic Auth** : Use if you authenticate to your API using a username and password.
     * **Pass-through** : Use if you authenticate to your API by passing authorization headers.
     * **Client ID enforcement via headers** : Use if you authenticate to your API passing `client_id` and `client_secret` headers.
     * **Client ID enforcement via query parameters** : Use if you authenticate to your API passing `client_id` and `client_secret` query params.
     * **OAuth 2.0 Client Credentials** : Use if you authenticate to your API by passing OAuth 2.0 `client_id`, `client_secret`, and authorization server values.
     * **Custom** : Use if you authenticate to your API using custom header parameters and values.
  8. Optionally, add a keystore to configure mutual authentication (mTLS) between the API and DataGraph.
If you’re promoting an API that already exists on the target environment, DataGraph checks if the API on the target environment has an existing keystore or truststore. If a keystore or truststore exist on the target environment, you can keep either, remove either, or remove either and add new ones. You cannot automatically send the keystore and truststore from the source environment to the target environment. To use the keystore and truststore from the source environment in the target environment, you must remove and re-add them during the promotion process.  
---  
Select **Configure Keystore** and provide the following:
     * A public certificate signed by your organization’s “root” certificate authority (CA)
     * The private key used to generate the certificate signing request (CSR)
     * The password for the encrypted private key
  9. Optionally, add a truststore to allow your API to be reached by your unified schema.
Select **Configure Truststore** and provide the certificate bundle that contains your root CA.
  10. Click **Next: Add to unified schema**.


## Promote an Updated API
After you’ve updated an API version, you can promote the updated version to another environment.
When you choose a new version of an API to promote, DataGraph lists any edits you’ve made to the current version that it can’t automatically apply to the new version in the target environment.
For any edits DataGraph can’t automatically apply, you’ll have the option to manually apply these edits before you complete the promotion.
Before you promote an updated API schema, you must first update the API version:
  1. Click **List of APIs added** and select the appropriate API.
  2. Click **API details**.
  3. Click **Promote API schema**.
  4. From the **Target environment** list, select the target environment for promotion.
  5. Click **Next**.
  6. If DataGraph finds changes it cannot apply, review the list of **Changes Not Applied** and manually apply them:
    1. Select a change and click **Next**.
    2. Edit the API schema as necessary and click **Apply Changes and Promote**.
After you apply the change, repeat Step 5 for any additional changes.
  7. Click **Next** to complete the remainder of the promotion steps.


## Additional Resources
  * Permissions for Anypoint DataGraph
  * Resolve Conflicts and Merge Inconsistencies
  * troubleshoot-schemas-queries.adoc#potential-errors-when-generating-an-api-schema