Publishing API Specifications | MuleSoft Documentation
# Publishing API Specifications
When you want to share your API specification with other developers, you can publish it to Anypoint Exchange.
## Before You Begin
It is a good practice to remove unreferenced files before publishing a project to Anypoint Exchange. An _unreferenced_ file is not referenced from the project’s root file, either directly or indirectly.
For example, if the file `example.raml` is among the files in a project but the root file of the project does not reference `example.raml` with an `!include` tag, the root file doesn’t reference `example.raml` directly. If none of the files in the chain of references from the root file directly references `example.raml`, it is not referenced indirectly from the root file. Therefore, `example.raml` is unreferenced and should probably not be among the files in the project.
If you do not remove them before you begin, unreferenced files are detected when you select the option to publish to Exchange, and you are given options on whether or not to publish them.
## Publish an API Specification
  1. In API Designer, open the API-specification project that you want to publish.
  2. If the specification has dependencies, click the refresh button beside `Exchange Dependencies` to ensure that Design Center has the latest status and content from all dependencies.
  3. Click **Publish** and then click **Publish to Exchange**.


**Asset version** : The version number to be displayed in the **Version** section of the page that Anypoint Exchange creates for the project. For a description of this field, see Asset Version.  
---  
**API version** : The version number of the API specification. For a description of this field, see API Version. 
  * the **Asset version** and **API version** fields are now pre-populated using the following criteria
    * If no version is defined in the API spec, the suggested asset version and API version fields are pre-filled with default values: `1.0.0` and `v1`.
    * If the version defined in the API spec matches asset version field recommendations (for example, `1.0.3`), the value is pre-filled in the asset version field, and the API version field is pre-filled with a `v` and the major asset version (for example, `v1`).
    * If the version defined in the API spec matches API version field recommendations (for example, `v2`), the value is pre-filled in the API version field, and the asset version field is pre-filled with its major value extracted (for example, `2.0.0`).
    * If the version defined in the API spec is a different string (for example, `7.4`), the value is pre-filled in the API version field, and the asset version field is pre-filled with its default value: `1.0.0`.
    * If the API has a version already published to Exchange (for example,`3.2.5`), when publishing a new version without changing the one defined in the API spec, the asset version field is pre-filled with its previous value incremented by one (for example, `3.2.6`), and the API version field stays the same.

  
**LifeCycle State** : The lifecycle state of the asset. Assets can be published from API Designer as **Development** or **Stable**. Assets cannot be deprecated from API Designer.  
**Business group ID** : The ID of the business unit in Anypoint Platform to which the project belongs.  
**Asset name** : The name that Anypoint Exchange uses to identify the published project.  
**Asset ID** : A unique ID that Anypoint Exchange uses to identify the published project. You should use the default unless there is a published asset with the same ID.  
  4. After completing the required fields, click **Publish to Exchange**.
If your project includes files that are not referenced by the root file either directly or indirectly, a dialog asks you to confirm that you want to publish the project including the unreferenced files. By default, API Designer excludes them from the published project in Anypoint Exchange.


If you are using a version of Anypoint Platform released prior to April 2017 and want to add the asset to API Manager while publishing to Exchange, select **Add to API Manager**. This functionality is not available in later versions and instead you can link API instances in API Manager to assets in Exchange.   
---  
## Asset Version
Anypoint Exchange requires an asset version number for each API specification published. The asset version must be specified using semantic versioning rules. For details, see Change the Version of an Asset.
The content of the **Asset version** field on the publish dialog depends on the following:
  * If you are publishing the specification for the first time, you can use any valid number based on the semantic versioning scheme. A typical starting version is `1.0.0`.
  * If you are republishing the specification, API Designer automatically populates the **Asset version** field with the existing patch level number incremented by 1. You can change this number, but the republish fails if you use a version number that has already been used to publish a stable version of this API.
  * If you are republishing the specification and select `Development`, you can use the same number as a previously published development version of the API, but not the same number as a previously published stable version.


## API Version
Anypoint Exchange requires an API version number for each API specification published.
The content and state of the **API version** field in the publish dialog depends on the following:
  * If the specification already includes a version, you cannot update it in the publish dialog.
  * If the specification does not include a version, you must enter the version in the **API version** field.


## See Also
  * Publish Assets Workflow
  * Explore Asset Information
  * Change the Version of an Asset
  *