---
title: "Api List Environments V2"
method: GET
path: "/api/v2/environment/"
tags: ["api"]
---

# Api List Environments V2

`GET /api/v2/environment/`

Retrieve a list of environments.

Parameters
----------
auth : Authentication
    Authentication instance for the request. Used to get role bindings
    and filter environments returned to those visible by the user making
    the request
entity : AuthenticationToken
    Token of the user making the request
paginated_args : CursorPaginatedArgs
    Arguments for controlling pagination of the response
conda_store : app.CondaStore
    The running conda store application
search : Optional[str]
    If specified, filter by environment names or namespace names containing the
    search term
namespace : Optional[str]
    If specified, filter by environments in the given namespace
name : Optional[str]
    If specified, filter by environments with the given name
status : Optional[schema.BuildStatus]
    If specified, filter by environments with the given status
packages : Optional[List[str]]
    If specified, filter by environments containing the given package name(s)
artifact : Optional[schema.BuildArtifactType]
    If specified, filter by environments with the given BuildArtifactType
jwt : Optional[auth_schema.AuthenticationToken]
    If specified, retrieve only the environments accessible to this token; that is,
    only return environments that the user has 'admin', 'editor', and 'viewer'
    role bindings for.

Returns
-------
schema.APIListEnvironment
    Paginated JSON response containing the requested environments. Cursor-based pagination
    is used.

    Note that the Environment objects returned here have their `current_build` fields omitted
    to keep the repsonse size down; these fields otherwise drastically increase the response
    size.

## Query parameters

- `artifact` 'DIRECTORY' | 'LOCKFILE' | 'LOGS' | 'YAML' | 'CONDA_PACK' | 'DOCKER_MANIFEST' | 'CONSTRUCTOR_INSTALLER' | 'CONTAINER_REGISTRY' | 'DOCKER_BLOB'
- `jwt` string, nullable
- `name` string, nullable
- `namespace` string, nullable
- `packages` string[], nullable
- `search` string, nullable
- `status` 'QUEUED' | 'BUILDING' | 'COMPLETED' | 'FAILED' | 'CANCELED'
- `order` 'asc' | 'desc'
- `limit` integer, nullable
- `sort_by` string[]
- `cursor` string, nullable

## Response `200`

Successful Response

- APIV2ListEnvironment
  - `count` integer, required
  - `cursor` string, nullable
  - `data` Environment[]
    - `current_build` Build
      - `build_artifacts` BuildArtifact[], nullable
        - `artifact_type` 'DIRECTORY' | 'LOCKFILE' | 'LOGS' | 'YAML' | 'CONDA_PACK' | 'DOCKER_MANIFEST' | 'CONSTRUCTOR_INSTALLER' | 'CONTAINER_REGISTRY' | 'DOCKER_BLOB', required
        - `id` integer, required
        - `key` string, required
      - `ended_on` string, date-time, nullable
      - `environment_id` integer, required
      - `id` integer, required
      - `packages` CondaPackage[], nullable
        - `channel` CondaChannel, required
          - `id` integer, required
          - `last_update` string, date-time, nullable
          - `name` string, required
        - `id` integer, required
        - `license` string, nullable
        - `name` string, required
        - `summary` string, nullable
        - `version` string, required
      - `scheduled_on` string, date-time, required
      - `size` integer, required
      - `specification` Specification
        - `created_on` string, date-time, required
        - `id` integer, required
        - `name` string, required
        - `sha256` string, required
        - `spec` object, required
      - `started_on` string, date-time, nullable
      - `status` 'QUEUED' | 'BUILDING' | 'COMPLETED' | 'FAILED' | 'CANCELED', required
      - `status_info` string, nullable
    - `current_build_id` integer, required
    - `description` string, nullable
    - `id` integer, required
    - `name` string, required
    - `namespace` Namespace, required
      - `id` integer, required
      - `metadata_` object, nullable
      - `name` string, required
      - `role_mappings` NamespaceRoleMapping[]
        - `entity` string, required
        - `id` integer, required
        - `role` string, required
  - `message` string, nullable
  - `status` 'ok' | 'error', required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/conda-incubator/apis/conda-store.md) · [All operations](https://skmtc.net/conda-incubator/apis/conda-store/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/conda-incubator/conda-store/revisions/1045c7d5b017/schema)
