Loading

Errors: "Error publishing to Exchange: The asset is invalid | Error while trying to set type: rest-api. Expected type is: app."

Publiseringsdato: Jul 21, 2025
Løsning

SYMPTOM

When publishing an asset to Anypoint Exchange from Design Center, Maven, or another method, it fails with the following error:
Error publishing to Exchange: The asset is invalid | Error while trying to set type: rest-api. Expected type is: app.


CAUSE

You are trying to publish two assets with the same name and under the same Business Group, but one of type Rest API ("rest-api") and the other Mule application ("app") type. Unfortunately, this not supported.

You can confirm if there is an app type asset with that name in Exchange by adding type=app in your Exchange URL to filter it, since there is no current UI filter:
https://anypoint.mulesoft.com/exchange/?type=app&show=all&sort=last

Furthermore, you can use the below command from Exchange API to list that asset:
curl 'https://anypoint.mulesoft.com/exchange/api/v2/assets/BG ID/ASSET ID/asset' --header 'Authorization: Bearer xxxxx'


SOLUTION

There are two options to fix it. 
  1. If the previous asset is no longer used, delete the asset.
  2. Rename the current asset name. 
Knowledge-artikkelnummer

001117288

 
Laster
Salesforce Help | Article