Lists all environments of an account. The response is paginated.
This endpoint replaces the deprecated GET all environments v2 endpoint.
The request produces an application/json payload.
GET |
|
To execute this request, you need the Allow read access for environment resources (account-env-read) scope assigned to your token. To learn how to obtain and use it, see Authenticate to Account Management with OAuth clients.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| account-uuid | string | The ID of the required account. You can find the UUID on the Account Management > Identity & access management > OAuth clients page, during creation of an OAuth client. | path | Required |
| environment-state | string | Filters environments by state. The element can hold these values
| query | Optional |
| page | string | The page cursor. Use the nextPageKey value from the previous response to request the next page. | query | Optional |
| page-size | integer | Defines the requested number of entries per page. The maximum is 500. | query | Optional |
| Code | Type | Description |
|---|---|---|
| 200 | Environment | - |
EnvironmentPageDto object| Element | Type | Description |
|---|---|---|
| records | Environment | The environments on the current page. |
| nextPageKey | string | The cursor for the next page. Pass it as the page query parameter. |
| totalRecordCount | integer | The total number of environments that match the request. |
| hasNextPage | boolean | Whether more pages are available. |
EnvironmentRecordDto object| Element | Type | Description |
|---|---|---|
| environmentUuid | string | The UUID of the environment. |
| friendlyName | string | The friendly name of the environment. |
| platformEnabled | boolean | Whether Dynatrace Platform is enabled for the environment. |
| state | string | The state of the environment. The element can hold these values
|
| urlAlias | string | The URL alias of the environment. |
| url | string | The URL of the environment. |
{"records": [{"environmentUuid": "string","friendlyName": "string","platformEnabled": true,"state": "RUNNING","urlAlias": "string","url": "string"}],"nextPageKey": "string","totalRecordCount": 1,"hasNextPage": true}
In this example, the request lists the first environment page of the account with the UUID of c4f3c4f3-c4f3-c4f3-c4f3-c4f3c4f3c4f3. Replace ACCOUNT_UUID and BEARER_TOKEN in the request with your own values.
curl --request GET \--url 'https://api.dynatrace.com/env/v3/accounts/ACCOUNT_UUID/environments?page-size=100' \--header 'Authorization: Bearer BEARER_TOKEN'
https://api.dynatrace.com/env/v3/accounts/ACCOUNT_UUID/environments?page-size=100
{"records": [{"environmentUuid": "c4f3c4f3-c4f3-c4f3-c4f3-c4f3c4f3c4f3","friendlyName": "Sample environment","platformEnabled": true,"state": "RUNNING","urlAlias": "abc12345","url": "https://abc12345.apps.dynatrace.com"}],"nextPageKey": "string","totalRecordCount": 1,"hasNextPage": false}
200