> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List environments

> List environments under the current account with cursor pagination.

`GET /api/v1/cloud/environments`

Lists environments under the current account with cursor pagination. Archived environments are excluded by default.

## Headers

| Header          | Required | Description    |
| --------------- | -------- | -------------- |
| `Authorization` | Yes      | `Bearer <PAT>` |

## Query parameters

| Parameter          | Type    | Required | Default | Description                                                                      |
| ------------------ | ------- | -------- | ------- | -------------------------------------------------------------------------------- |
| `limit`            | integer | No       | 20      | Items per page. Range 1-100; values above 100 return `400 invalid_request_error` |
| `page`             | string  | No       | -       | Cursor returned by the previous response's `next_page`                           |
| `include_archived` | boolean | No       | `false` | Set to `true` to include archived environments                                   |
| `created_at[gte]`  | string  | No       | -       | Include environments created at or after this RFC 3339 timestamp                 |
| `created_at[lte]`  | string  | No       | -       | Include environments created at or before this RFC 3339 timestamp                |

See [Pagination](/cloud-agents/api/conventions/pagination) for cursor semantics.

## Example request

```bash theme={null}
curl -s -X GET 'https://api.qoder.com/api/v1/cloud/environments' \
  -H "Authorization: Bearer $QODER_PAT"
```

## Example response

**HTTP 200 OK**

```json theme={null}
{
  "data": [
    {
      "id": "env_019e3bb39b6774d8878cd0b9d237574b",
      "type": "environment",
      "name": "doc-test-env",
      "description": "",
      "config": {
        "type": "cloud",
        "networking": {
          "type": "limited",
          "allowed_hosts": [],
          "allow_package_managers": false,
          "allow_mcp_servers": false
        },
        "packages": {
          "type": "packages",
          "apt": ["curl"],
          "npm": [],
          "pip": []
        }
      },
      "metadata": {},
      "archived_at": null,
      "created_at": "2026-05-18T15:28:07.017808Z",
      "updated_at": "2026-05-18T15:28:07.017808Z"
    },
    {
      "id": "env_019e2590d33f711fabf42f2857cecd8a",
      "type": "environment",
      "name": "default",
      "description": "",
      "config": {
        "type": "cloud",
        "networking": {
          "type": "limited",
          "allowed_hosts": [],
          "allow_package_managers": false,
          "allow_mcp_servers": false
        },
        "packages": {
          "type": "packages",
          "apt": [],
          "npm": [],
          "pip": []
        }
      },
      "metadata": {},
      "archived_at": null,
      "created_at": "2026-05-14T08:18:28.800813Z",
      "updated_at": "2026-05-14T08:18:28.800813Z"
    }
  ],
  "first_id": "env_019e3bb39b6774d8878cd0b9d237574b",
  "has_more": false,
  "last_id": "env_019e2590d33f711fabf42f2857cecd8a",
  "next_page": null
}
```

## Response fields

| Field       | Type                                                                                     | Description                                                                          |
| ----------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| `data`      | array of [Environment object](/cloud-agents/api/environments/schemas#environment-object) | Environments on the current page                                                     |
| `first_id`  | string                                                                                   | ID of the first record on this page                                                  |
| `last_id`   | string                                                                                   | ID of the last record on this page                                                   |
| `has_more`  | boolean                                                                                  | Whether more records remain                                                          |
| `next_page` | string\|null                                                                             | Cursor for the next page. Equals `last_id` when `has_more` is true, otherwise `null` |

## Errors

| HTTP | Type                    | Trigger                                                |
| ---- | ----------------------- | ------------------------------------------------------ |
| 400  | `invalid_request_error` | `limit` is not a positive integer                      |
| 400  | `invalid_request_error` | Invalid pagination cursor                              |
| 400  | `invalid_request_error` | `created_at[gte]` or `created_at[lte]` is not RFC 3339 |
| 401  | `authentication_error`  | PAT invalid or expired                                 |
| 403  | `permission_error`      | Not authorized for this resource                       |

See [Errors](/cloud-agents/api/conventions/errors) for the full error envelope.

## Notes

* Records are returned in descending ID order by default.
* Archived environments do not appear in the default listing. Pass `include_archived=true` to include them.
* Pagination is cursor-based; offset-based pagination is not supported.

## Related

<CardGroup cols={2}>
  <Card title="Cloud environment setup" icon="server" href="/cloud-agents/environments">
    Choose the container, network, and dependencies your agent runs in.
  </Card>
</CardGroup>
