When calling the CloudHub 2.0 application manager API to retrieve deployment specifications using a connected app bearer token, the request fails with an HTTP 401 Unauthorized status, even though the connected app has the Read Applications scope and other deployment endpoints succeed.
A connected app that uses the client credentials grant calls the CloudHub 2.0 Application Manager API to list the specs of a deployment:
GET /amc/application-manager/api/v2/organizations/{orgId}/environments/{envId}/deployments/{deploymentId}/specs
The request fails with HTTP 401 and this body:
{"status":401,"error":"Unauthorized","message":"Unauthorized"}
The connected app has the Read Applications scope, and the same token succeeds on other Application Manager endpoints:
| Endpoint | Result |
|---|---|
| GET .../deployments | 200 |
| GET .../deployments/{deploymentId}/specs | 401 |
| GET .../deployments/{deploymentId}/specs/{specId}/logs | 200 |
The same /specs call also works in the Runtime Manager UI under a user session, because user roles already include the required permission.
The CloudHub 2.0 deployment specification endpoint (/amc/application-manager/api/v2/organizations/{org}/environments/{env}/deployments/{deploymentId}/specs) relies on internal Runtime Fabric control plane models. Accessing this endpoint requires the Read Runtime Fabrics scope at the organization level in addition to the Read Applications scope. If the connected app only has Read Applications, the request is denied.
Add the Read Runtime Fabrics permission to your connected app at the organization level and issue a new bearer token.
Verify:
Run a GET request to the specs endpoint using the newly issued bearer token:
curl -X GET "https://anypoint.mulesoft.com/amc/application-manager/api/v2/organizations/{orgId}/environments/{envId}/deployments/{deploymentId}/specs" \ -H "Authorization: Bearer <NEW_TOKEN>"
The request completes successfully with an HTTP 200 OK response status.
NOTE
If the request returns 409 with "Unable to fetch the target associated with this deployment", the scope is working but the deployment's target cannot be resolved (for example, a removed private space). Contact MuleSoft Support.
APPLIES TO
- CloudHub 2.0
- Anypoint Platform Connected Apps (client credentials)
- Application Manager API v2
005465236

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.