---
title: "List Environments - V2"
method: GET
path: "/api/v2/org/{orgId}/envs"
tags: ["Applications"]
---

# List Environments - V2

`GET /api/v2/org/{orgId}/envs`

## List Environments V2
Lists environments that belong to this organization.

Returns a [**new style** paginated list](https://apidocs.stackhawk.com/docs/pagination-and-sorting) of Environments.

| Parameter | Default | Description |
|:---:|:---:|:---:|
|orgId|""|The org id that these environments belong to.|
|environments|[]|List of environment views.|
|totalCount|0|Total number of environments in the results.|
|currentPage|{}|The current page.|
|hasNext|false|Whether or not there is a next page.|
|nextPage|{}||
|nextPageToken|""||
|hasPrev|false|Whether or not there is a previous page.|
|prevPage|{}||
|prevPageToken|""||
|findingsHealth|{}||
|scanFrequencyHealth|{}||

### Environment



| Parameter | Default | Description |
|:---:|:---:|:---:|
|environmentId|""|The UUID identifier of this environment.|
|environmentName|""|The name of this environment.|
|applicationId|""|The UUID identifier of this application.|
|applicationName|""|The name of this application.|
|lastScanId|""|The UUID identifier of the last scan id|
|lastScanTotalUntriaged|0|The total number of untriaged alerts in the last scan.|
|lastScanHighUntriaged|0|The total number of high untriaged alerts in the last scan.|
|lastScanMediumUntriaged|0|The total number of medium untriaged alerts in the last scan.|
|lastScanLowUntriaged|0|The total number of low untriaged alerts in the last scan.|
|lastScanTimestamp|0|The timestamp of when the last scan started.|
|lastScanDuration|0|The duration of the last scan.|
|lastScanStatus|"UNKNOWN"|the status of the last scan.|
|applicationStatus|"UNKNOWN"|the status of the application.|
|repositoriesCount|0|the number of repositories mapped to an application|
|attackSurface|{}|the attack surface details for the application.|
|latestScanConfigHash|""|the config hash of the latest scan config|
|lastScanCompletedTimestamp|0|the timestamp of when the last scan completed.|
|lastScanHawkscanVersion|""|the version of HawkScan used for the last scan.|
|thirtyDayCommitActivity|0|the number of commits made in all connected repositories in the past 30 days for this application.|
|lastScanExternalAlertStats|[]|Stats about any linked external SAST integrations used to look for related findings.|
|cloudScanTarget|{}|Cloud Scan Target configuration.|
|applicationType|"UNKNOWN"|The type of this environment's associated application.|
|screenrMetadata|[]|Screenr (flightpath) session metadata. Null/absent if no session.|
|lastScanHawkScanType|"UNKNOWN"|The type of HawkScan execution for the last scan (traditional, hosted, etc.)|

The returned list of environments is filtered by the organization id and User's API Token Team membership.

### Filter Query Params

* `query`: A string to filter by application and environment name (both are matched on for now).
* `appIds`: A comma-separated list of application uuids to filter by.
* `envIds`: A comma-separated list of environment uuids to filter by.
* `teamIds`: A comma-separated list of team uuids to filter by.
* `envs`: A comma-separated list of environment names to filter by.
* `lastScanDate`: A last scan date qualifier to filter by. Possible values are `LAST_24_HOURS`, `LAST_7_DAYS`, `LAST_14_DAYS`, `LAST_30_DAYS`, `OVER_30_DAYS`.
* `lastScanDateStatus`: A comma-separated list of last scan date statuses to filter by. Possible values are `LAST_SCAN_STATUS_SUCCESS`, `LAST_SCAN_STATUS_ERRORED`, `LAST_SCAN_STATUS_IN_PROGRESS`, and `LAST_SCAN_STATUS_PENDING`.

### Last Scan Fields

All fields relating to the last scan for a given environment are just that - the last scan recorded for that given environment. If there are no scans, these fields will be empty.
If you need more than the most recent scan, use the scan list API instead.


> Requires `read:application` permission.

## Path parameters

- `orgId` string, uuid, required

## Query parameters

- `query` string
- `sortField` 'environmentId' | 'environmentName' | 'applicationName' | 'scanDate' | 'scanDuration' | 'mappedRepositoryCount' | 'scanFindingsCounts' | 'thirtyDayCommitActivity' | 'flightpathLastUpdated'
- `sortDir` 'ASC' | 'DESC' | 'UNSORTED'
- `includeAppHealthStats` boolean
- `page` string
- `pageSize` integer
- `pageToken` integer
- `appIds` string[]
- `envIds` string[]
- `teamIds` string[]
- `envs` string[]
- `lastScanDate` 'LAST_SCAN_DATE_UNSPECIFIED' | 'LAST_24_HOURS' | 'LAST_7_DAYS' | 'LAST_14_DAYS' | 'LAST_30_DAYS' | 'OVER_30_DAYS'
- `applicationTypes` string[]
- `lastScanStatus` string[]
- `hasFlightpathSession` boolean

## Response `200`

Paginated response of application environments.

- ApplicationViewListEnvironmentsViewResponse — Paginated response of application environments.
  - `currentPage` PaginationPage
    - `filters` PaginationFilter[] — Generic filters that each type can define for its needs (isConnected=true, hasMapping=false, etc)
      - `multi` PaginationMultiValue
        - `values` string[] — The values of a given filter to filter on.
      - `name` string — The name of the filter to apply.
      - `value` string — A single value to filter on.
    - `number` integer — The page number to retrieve - 0 based
    - `query` string — The query string to filter the results.
    - `size` integer — the page size to retrieve.
    - `sortOptions` PaginationSortOptions
      - `direction` 'ASC' | 'DESC' | 'UNSORTED' — The direction to sort the results.
      - `field` string — Generic here, each type should define its own Enums + Converters
  - `environments` ApplicationViewEnvironmentView[] — List of environment views.
    - `applicationId` string — The UUID identifier of this application.
    - `applicationName` string — The name of this application.
    - `applicationStatus` 'ACTIVE' | 'ENV_INCOMPLETE' — the status of the application.
    - `applicationType` 'STANDARD' | 'CLOUD' — The type of this environment's associated application.
    - `attackSurface` AttackSurfaceApplicationAttackSurface
      - `applicationId` string — the application id for the slick of attack surface details.
      - `repositories` RepositoryRepository[] — the total view of repositories mapped to an application.
        - `appInfos` RepositoryAppInfo[] — The mapped applications to this repository
          - `appStatus` 'ACTIVE' | 'ENV_INCOMPLETE' — Read-only field for the application status.
          - `id` string — The application id.
          - `lastScanHost` string — Read-only field for the last scan host.
          - `lastScanId` string — Read-only field for the last scan id.
          - `lastScanTimestamp` integer — Read-only field for the last scan timestamp.
          - `name` string — The application name.
        - `archived` boolean — Whether or not this repository is archived.
        - `cloneTimestamp` integer — clone timestamp.
        - `commitCount` integer — The number of commits in the past 30 days.
        - `commitSha` string — last recorded commitSha of the default branch.
        - `fork` boolean — Whether or not this repository is a fork.
        - `frameworkNames` string[] — the frameworks discovered for the repository
        - `hasGeneratedOpenApiSpec` boolean — Whether or not the repository has a generated open api spec
        - `hidden` boolean — Whether or not this repository is hidden.
        - `insights` RepositoryInsight[] — The StackHawk API Discovery results of this repository.
          - `name` string — The name of the StackHawk API Discover insight.
          - `value` string — The processed response of the StackHawk API Discovery insight.
        - `isInAttackSurface` boolean — Whether or not this repository is in the StackHawk API Discovery Attack Surface.
        - `isNewRepository` boolean — Whether or not this repository is new.
        - `isNewToAttackSurface` boolean — Whether or not this repository is new to the attack surface.
        - `languages` RepositoryLanguage[] — The languages used in this repository.
          - `name` string — The name of the language.
          - `percent` number, double — The percentage that this language comprises in a repository.
          - `size` integer — The number of bytes of this language in a repository.
          - `stackHawkId` string — The StackHawk language id.
        - `lastCommitBranch` string — The last branch committed to for this repository.
        - `lastCommitTimestamp` integer — The last commit timestamp of the repository.
        - `lastContributor` RepositoryContributor
          - `avatarUrl` string — The avatar url of the contributor.
          - `contributions` integer — The number recent of contributions.
          - `email` string — The email of the contributor - frequently blank.
          - `lastContributionTimestamp` integer — The last time this user contributed.
          - `name` string — The username of the contributor.
          - `remoteId` string — The remote contributor id.
          - `source` 'UNKNOWN' | 'GITHUB' | 'AZURE_DEVOPS' | 'BITBUCKET' | 'GITLAB' — The source of the contributor.
          - `stackhawkId` string — The StackHawk contributor id.
        - `lastScanHost` string — Deprecated - the last scan host of the associated application. Use appInfos instead.
        - `lastScanId` string — Deprecated - the last scan id of the associated application. Use appInfos instead.
        - `lastScanTimestamp` integer — Deprecated - the last scan timestamp of the associated application. Use appInfos instead.
        - `name` string — The name of the repository
        - `namespace` string — Provider dependent, optional namespace/group/subgroup/folder the repository belongs to.
        - `namespaceId` string — If applicable, the unique identifier of the repository's namespace.
        - `notes` RepositoryRepositoryNote[] — Notes/comments added to this repository by users.
          - `note` string — The text content of the note.
          - `stackhawkId` string — The unique StackHawk identifier for this note.
          - `timestamp` integer — The timestamp when this note was created (Unix timestamp in milliseconds).
          - `userEmail` string — The email of the user who created this note.
        - `openApiSpecInfo` OpenApiSpecOpenAPISpecInfo
          - `details` string
          - `generatedOasCount` integer
          - `info` string
          - `organizationId` string
          - `repositoryId` string
          - `repositoryMetadata` OpenApiSpecRepositoryMetadata
            - `languages` string[]
            - `matchWords` CodeWordMatchWord[]
              - …
            - `sourceRoots` OpenApiSpecSourceRoot[]
              - …
          - `startDate` integer
          - `status` 'NONE' | 'BUILDING' | 'DONE' | 'ERROR' | 'UNABLE_TO_COMPLETE' | 'NOT_APPLICABLE'
        - `private` boolean — Whether or not this repository is private.
        - `providerOrgId` string — Unique identifier of the repository's organization or equivalent entity type.
        - `providerOrgName` string — The repository provider's top level entity this repository is associated with.
        - `remoteUrl` string — The remote url of the repository.
        - `repoSize` integer — last recorded size of repository in bytes.
        - `repoSource` 'UNKNOWN' | 'GITHUB' | 'AZURE_DEVOPS' | 'BITBUCKET' | 'GITLAB' — The source of the repository.
        - `score` integer — The StackHawk API Discovery Score.
        - `sensitiveDataTags` RepositoryTag[]
          - `name` string — The name of the tag.
          - `stackHawkId` string — The StackHawk tag id.
        - `stackHawkApplicationId` string — Deprecated - the application id associated with this repository. Use appInfos instead.
        - `stackHawkApplicationName` string — Deprecated - the application name associated with this repository. Use appInfos instead.
        - `stackHawkApplicationStatus` 'ACTIVE' | 'ENV_INCOMPLETE' — Deprecated - the application status of the associated application. Use appInfos instead.
        - `stackHawkIntegrationId` string — The Integration Id this repository is associated to.
        - `stackHawkRepoId` string — The StackHawk repository id.
        - `status` 'NOT_APPLICABLE' | 'NOT_COVERED' | 'COVERED' — The StackHawk API Discovery Status.
        - `topics` RepositoryTopic[] — The topics of this repository.
          - `name` string — The name of the topic.
          - `stackHawkId` string — The StackHawk topic id.
    - `cloudScanTarget` ApplicationCloudScanTarget — Cloud Scan Target Configuration.
      - `isDomainVerified` boolean — Indicates if the domain is verified or not.
      - `targetURL` string — The target URL.
    - `environmentId` string — The UUID identifier of this environment.
    - `environmentName` string — The name of this environment.
    - `lastScanCompletedTimestamp` integer — the timestamp of when the last scan completed.
    - `lastScanDuration` integer — The duration of the last scan.
    - `lastScanExternalAlertStats` SastExternalAlertStats[] — Stats about any linked external SAST integrations used to look for related findings.
      - `integrationType` 'UNKNOWN' | 'SLACK' | 'JIRA' | 'DATADOG' | 'MSTEAMS' | 'WEBHOOK' | 'JIRA_SERVER' | 'SNYK' | 'GITHUB' | 'MERGE_AZURE_DEVOPS_BOARDS' | 'VANTA' | 'AZURE_DEVOPS' | 'BITBUCKET' | 'GITLAB' | 'EMAIL' | 'GITHUB_ENTERPRISE' | 'GITLAB_SELF_HOSTED' | 'BITBUCKET_SELF_HOSTED' | 'AZURE_DEVOPS_SELF_HOSTED' | 'SEMGREP' | 'ENDOR_LABS' | 'WIZ'
      - `projectUrl` string
    - `lastScanHawkScanType` 'HAWKSCAN_TYPE_SCAN' | 'HAWKSCAN_TYPE_FLIGHTPATH' | 'HAWKSCAN_TYPE_HOSTED' | 'HAWKSCAN_TYPE_CONFIGURATION' — The type of HawkScan execution for the last scan (traditional, hosted, etc.)
    - `lastScanHawkscanVersion` string — the version of HawkScan used for the last scan.
    - `lastScanHighUntriaged` integer — The total number of high untriaged alerts in the last scan.
    - `lastScanId` string — The UUID identifier of the last scan id
    - `lastScanLowUntriaged` integer — The total number of low untriaged alerts in the last scan.
    - `lastScanMediumUntriaged` integer — The total number of medium untriaged alerts in the last scan.
    - `lastScanStatus` 'UNKNOWN' | 'COMPLETED' | 'ERROR' | 'STARTED' — the status of the last scan.
    - `lastScanTimestamp` integer — The timestamp of when the last scan started.
    - `lastScanTotalUntriaged` integer — The total number of untriaged alerts in the last scan.
    - `latestScanConfigHash` string — the config hash of the latest scan config
    - `repositoriesCount` integer — the number of repositories mapped to an application
    - `screenrMetadata` object — Screenr (flightpath) session metadata. Null/absent if no session.
    - `thirtyDayCommitActivity` integer — the number of commits made in all connected repositories in the past 30 days for this application.
  - `findingsHealth` ApplicationViewApplicationFindingsHealthStats
    - `high` integer
    - `low` integer
    - `medium` integer
    - `total` integer
  - `hasNext` boolean — Whether or not there is a next page.
  - `hasPrev` boolean — Whether or not there is a previous page.
  - `nextPage` PaginationPage
    - `filters` PaginationFilter[] — Generic filters that each type can define for its needs (isConnected=true, hasMapping=false, etc)
      - `multi` PaginationMultiValue
        - `values` string[] — The values of a given filter to filter on.
      - `name` string — The name of the filter to apply.
      - `value` string — A single value to filter on.
    - `number` integer — The page number to retrieve - 0 based
    - `query` string — The query string to filter the results.
    - `size` integer — the page size to retrieve.
    - `sortOptions` PaginationSortOptions
      - `direction` 'ASC' | 'DESC' | 'UNSORTED' — The direction to sort the results.
      - `field` string — Generic here, each type should define its own Enums + Converters
  - `nextPageToken` string
  - `orgId` string — The org id that these environments belong to.
  - `prevPage` PaginationPage
    - `filters` PaginationFilter[] — Generic filters that each type can define for its needs (isConnected=true, hasMapping=false, etc)
      - `multi` PaginationMultiValue
        - `values` string[] — The values of a given filter to filter on.
      - `name` string — The name of the filter to apply.
      - `value` string — A single value to filter on.
    - `number` integer — The page number to retrieve - 0 based
    - `query` string — The query string to filter the results.
    - `size` integer — the page size to retrieve.
    - `sortOptions` PaginationSortOptions
      - `direction` 'ASC' | 'DESC' | 'UNSORTED' — The direction to sort the results.
      - `field` string — Generic here, each type should define its own Enums + Converters
  - `prevPageToken` string
  - `scanFrequencyHealth` ApplicationViewApplicationScanFrequencyHealthStats
    - `appsNeverScanned` integer
    - `appsScannedBeyondThirtyDays` integer
    - `appsScannedWithinSevenDays` integer
    - `appsScannedWithinThirtyDays` integer
    - `failedScansCount` integer
    - `totalApps` integer
  - `totalCount` integer — Total number of environments in the results.

## Other responses

- `401` — Unauthorized

---

[API](https://skmtc.net/stackhawk/apis/stackhawk-public-api.md) · [All operations](https://skmtc.net/stackhawk/apis/stackhawk-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stackhawk/stackhawk-public-api/revisions/ad3dfd54cb63/schema)
