Create an Asset

To share an API, API Group, policy, example, template, or connector in either an Anypoint Exchange private instance or an Exchange public portal, create an asset of that asset type.

The way to create an asset depends on its type. The type is set when the asset is created and cannot be changed.

  • For OAS, RAML, RAML fragments, HTTP, WSDL, and Custom assets, create the asset directly using the Exchange Publish new asset menu.

  • For an example or template, create each using the Mavenize feature in Anypoint Studio, and publish each to Exchange.

  • For a connector, policy, example, or template, see Publish and Deploy Exchange Assets Using Maven.

  • You can also publish a RAML, or OAS or RAML fragments, using Design Center, and publish the API to Exchange.

    Another way to publish these type of assets is using the Exchange Experience API.

  • RAML and OAS API specifications can be uploaded to Exchange with the Anypoint Platform Command Line Interface (CLI).

    For example: exchange asset upload --classifier raml --apiVersion v1 --name HelloWorld --mainFile helloworld.raml helloword/1.0.0 /Users/nmouso/Downloads/helloworld.raml.zip

  • API Groups are published to Exchange from Anypoint API Manager.

Each asset in Exchange is versioned. You can manage which versions are visible by deprecating a version to hide it, and you can delete versions if needed. All versions of an asset always have the same type.

In addition to asset versions, APIs have a consumer facing API version that is shown at the top of an asset’s detail screen. This API version is defined by API providers.

Exchange asset versions follow the Semantic Versioning model of major, minor, and patch releases. For example, if an asset is version 2.4.6, then its major version is 2.x.x, its minor version is 2.4.x, and its patch version is 2.4.6.

To select a minor version of an asset, use the menu next to the asset name at the top of the asset portal. To select a patch version of an asset, use the version list at the right.

RAML versions have been automatically generated for all OAS assets published since January 12, 2019, and OAS 2.0 versions have been automatically generated for all RAML assets published since that date.

Exchange fully supports RAML fragments. Currently, Exchange does not support importing and managing OAS 3.0 components as Exchange dependencies inside a specification.

This illustration summarizes how each asset type (in green) appears in Exchange:

ex2 exchange assets

Asset Limits

Exchange prevents resource exhaustion attacks by limiting the number of asset versions that can be published.

The limit is 500 assets for root organizations with trial accounts, and 100,000 (one hundred thousand) assets for other root organizations.

The limit of dependencies for an asset is 100. For example, in Anypoint API Designer a RAML is limited to 100 RAML Fragment dependencies, and in Anypoint API Manager an API Group is limited to 100 REST API dependencies.

This asset count does not include deleted assets or assets generated by Exchange such as Mule 3 and Mule 4 connectors generated automatically from APIs.

When a root organization reaches 80% of its asset limit, Exchange shows a warning.

When a root organization reaches its asset limit, Exchange shows an error. Also, using the Publish new asset button on the home page or the Add new version button on the asset detail page shows an error explaining that the limit is reached and no more assets can be added.

Check the limit of your root organization with a curl command like this:

    curl -X GET \
      https://anypoint.mulesoft.com/exchange/api/v1/organizations/ROOT_ORGANIZATION_ID/limits \
      -H 'Authorization: bearer ANYPOINT_TOKEN'

Replace ROOT_ORGANIZATION_ID with your root organization ID, and replace ANYPOINT_TOKEN with the authorization token that has permissions for the root organization.

Get lists of assets with a curl command like this:

    curl -X POST \
      https://anypoint.mulesoft.com/graph/api/v1/graphql \
      -H 'content-type: application/json' \
      -H 'Authorization: bearer ANYPOINT_TOKEN' \
      -d '{"query":"{assets(query: { masterOrganizationId:\"ROOT_ORGANIZATION_ID\", limit: 20, offset: 10 }) {groupId assetId version}}"}'

Replace ROOT_ORGANIZATION_ID with your root organization ID, and replace ANYPOINT_TOKEN with the authorization token that has permissions for the root organization. Vary the limit and offset values as needed.

See Search Using the Graph API for more information about searching for assets.

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 Exchange, select Publish new asset.

  2. Enter the asset portal name.

  3. 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 and OAS 3.0 specifications.

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

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

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

  4. For RAML, API Spec Fragment, OAS, and WSDL assets:

    1. Select 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.

  5. (Optional) Select Advanced and edit the advanced settings: GroupId, AssetId, Version, and API version. Exchange generates the group ID, asset ID, and version for you, and you can change these values here. You can change an API asset’s version (asset version) and API version separately. The advanced settings are most often used to change the asset version.

  6. Select Publish.

To create a ZIP file and put the items in a folder into the root directory of the ZIP file, use a command like this. Replace myfolder with the name of your folder and name.zip with the name for the new ZIP file.

cd myfolder; zip -r name.zip .

Do not use a command such as zip -r name.zip myfolder, which puts the folder into the root directory of the ZIP file. This causes an error message such as The zip file does not contain a .raml file in the root directory.

Create an API Group Asset

An API Group is an asset that enables organizations to publish a group of API instances as a single unit, so that developer client applications can access the APIs as a group, using one client ID and, optionally, client secret.

API Groups are created in Anypoint API Manager and published to Exchange.

API Groups have major versions, such as 1.0.0, 2.0.0, or 3.0.0, but no minor or patch versions. Every version of an API Group has one or more API Group instances. Each API Group instance is a group of API instances that all have the same identity provider and the same environment type, either production or sandbox. An API Group instance can contain API instances from multiple business groups.

Creating an API Group requires having the Group Administrator permission, as well as the Asset Administrator permission for each of the APIs in the group. This ensures that a group creator can change the underlying APIs between private and public visibility levels.

If an API Group has any private APIs, you see a warning when publishing the API Group to your public portal. The public portal never shows private content. To ensure that all content in the API Group is published to the public portal, go to each API’s page in Exchange and make the API public, and then publish the API Group.

Warnings are also shown when publishing an API Group to your public portal if all of its API Group instances are private, and when making an API Group instance public if all of its API instances are private.

Create a Custom Asset

A custom asset lets you share information about any aspect of your organization such as announcements, documentation, videos, and sharing files. You can add an optional file to your Custom asset that users can download. The file is stored in Exchange.

Note: Exchange only permits the following file types as the optional file in a Custom asset:

Images: .jpg, .jpeg, .png, .gif, .svg
Documents: .docx, .pdf, .pptx, .rtf, .vsdx, .vssx
Compressed files: .zip, .tgz, .jar, .gz, .7z
Text files: .txt, .json, .raml, .yaml, .yml, .md, .csv, .xml, .xsd, .wsdl, .html, .pom, .log, .sql

A file without a file type is not allowed. All file types are case insensitive.

SVG files are limited to 100 KB or less.

MuleSoft recommends deleting all old Custom assets containing files of types that are not permitted. For any Custom asset containing a non-supported file, delete the asset to remove the file.

To create a custom asset:

  1. In Exchange, select Publish new asset.

  2. Enter the asset portal name.

  3. Select the asset type Custom from the drop-down list.

  4. (Optional) To share a file with users, choose the file.

  5. (Optional) Select Advanced and edit the advanced settings: GroupId, AssetId, and Version. Exchange generates the group ID, asset ID, and version for you, and you can change these values here. The advanced settings are most often used to change the asset version.

  6. Select Publish.

Asset Name, Icon, and Description Properties

You can create assets in API Designer or Exchange. After the asset is created, the name, icon, and description properties can only be changed in the Exchange asset details page as described in Describe an Asset.

Properties of Assets Created in API Designer

API Designer reads and uses the name of the asset from the RAML specification.

Before the asset is published in Exchange, you can edit the name in API Designer.

After the asset is published in Exchange, the name is used as the asset portal name. Any publication from API Designer to update the version of an asset in Exchange has the name field disabled, and shows the name from Exchange. The name, icon, and description properties can only be changed in the Exchange asset details page.

Properties of Assets Created in Exchange

When you create an asset in Exchange, you enter the name.

The name cannot be changed when adding a new version in Exchange.

The name, icon, and description properties can only be changed in the Exchange asset details page.

Create a New Version of an Existing Asset

If you have contributor or admin access to an asset, you can add a new version from the asset portal:

  1. In Exchange, open the asset list and select the asset.

  2. In the sidebar Versions table, select Add New Version.

  3. Enter the Version (asset version).

  4. (Optional) Enter the API version.

  5. (Optional) Choose a file to upload.

  6. Select Publish.

The new version of the asset has the same name, icon, and description as the previous version. Any changes to these properties apply to all versions of the asset.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub