Loading

CloudHub 2.0 Deployment Specs Endpoint Returns 401 Unauthorized With a Connected App Token

Publiceringsdatum: Oct 23, 2026
Beskrivning

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.

Lösning

CAUSE

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.

SOLUTION

Add the Read Runtime Fabrics permission to your connected app at the organization level and issue a new bearer token.

  1. In Anypoint Platform, navigate to Access Management > Connected Apps.
  2. Select your connected app and click Add Scopes.
  3. Select the Read Runtime Fabrics scope.
  4. When prompted for scope binding, bind the scope at the organization level (or the specific business group where the app resides).
  5. Click Add Scopes, then click Save.
  6. Wait up to 5 minutes for the scope updates to propagate across Anypoint Platform.
  7. Request a new bearer token using your client credentials grant. Do not reuse a cached token issued before the scope change.

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.

Ytterligare resurser

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

Knowledge-artikelnummer

005465236

 
Laddar
Salesforce Help | Article