Issue
Calling the Private Cloud Deploy API endpoint GET /api/v4/apps/{appId}/environments returns an empty response, although the application contains environments that are visible in Mendix Portal and the Personal Access Token (PAT) includes the required API scopes.
Environment
- Mendix Portal
- Private Cloud Deploy API
- Applications hosted in Mendix on Kubernetes
Cause
The authenticated account does not have the required namespace or cluster permissions for the application's deployment.
To retrieve environments through the API, the account must satisfy both of the following requirements:
- Be invited to the namespace as an Administrator, or to the cluster as a Cluster Manager.
- Be added to the application in Mendix Portal with a role that includes cloud permissions.
When either permission is absent, the endpoint returns an empty response.
Solution / Workaround
Verify that the account used to authenticate the API request has the required permissions by following these steps:
- Invite the account to the namespace where the application is deployed with the Administrator role, or invite the account to the cluster with the Cluster Manager role.
- Add the account to the application in Mendix Portal with a role that includes cloud permissions.
- Retry the
GET /api/v4/apps/{appId}/environmentsrequest. - Confirm that the API response includes the expected environments
Internal information related
- 278297
- C0161BEMQ4B/p1779357903970839
Additional information
Mendix documentation:
0 Comments