---
title: "List environments"
description: "Lists the caller organization's environments."
url: "https://www.thecompany.company/docs/api/environments/list"
---

# List environments

> Lists the caller organization's environments.

- **Surface:** The App API
- **Endpoint:** `GET https://api.thecompany.company/v1/environments`
- **Operation ID:** `environments.list`
- **Authentication:** `Authorization: Bearer <TOKEN>`

## Parameters

| Name | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `after` | `query` | `string` | No |  |
| `limit` | `query` | `string` | No |  |

## Responses

### `200` (`application/json`)

Success

Schema: `object`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array<Environment>` | Yes |  |
| `data[].id` | `string` | Yes | TypeID with prefix "env_". |
| `data[].name` | `string` | Yes | Human-readable display name for the environment |
| `data[].default` | `boolean` | Yes | Whether this is the organization's default environment |
| `data[].machineSize` | `string` | Yes | Sandbox VM size preset for an environment machine. |
| `data[].iconUrl` | `string \| null` | Yes | Manual public icon URL, or null to derive the icon from repository ownership. |
| `data[].snapshotId` | `string \| null` | Yes | The active snapshot sessions fork, or null while never built |
| `data[].snapshotPinned` | `boolean` | Yes | Whether the active snapshot is pinned: a pinned pointer does not move when a newer build publishes |
| `data[].nextBuildAt` | `string \| null` | Yes | When the next rebuild is due, or null while the environment has no repositories |
| `data[].createdAt` | `string` | Yes |  |
| `data[].updatedAt` | `string` | Yes |  |
| `firstId` | `string \| null` | Yes | ID of the first item in this page |
| `lastId` | `string \| null` | Yes | ID of the last item (use as cursor for next page) |
| `hasMore` | `boolean` | Yes | Whether more items exist after this page |

Example:

```json
{
  "data": [
    {
      "id": "env_01jd8z3k5q0b6f2m4r7t9v1x3c",
      "name": "Ship the new dashboard",
      "default": true,
      "machineSize": "small",
      "iconUrl": "string",
      "snapshotId": "string",
      "snapshotPinned": true,
      "nextBuildAt": "string",
      "createdAt": "string",
      "updatedAt": "string"
    }
  ],
  "firstId": "string",
  "lastId": "string",
  "hasMore": true
}
```

### `401` (`application/json`)

AuthenticationError

Schema: `AuthenticationError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `reason` | `string` | Yes |  |
| `description` | `string` | No |  |

Example:

```json
{
  "_tag": "AuthenticationError",
  "reason": "invalid_session",
  "description": "string"
}
```

### `402` (`application/json`)

OrganizationUnsubscribedError

Schema: `OrganizationUnsubscribedError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `code` | `string` | Yes |  |

Example:

```json
{
  "_tag": "OrganizationUnsubscribedError",
  "code": "ORGANIZATION_UNSUBSCRIBED"
}
```

### `403` (`application/json`)

UnauthorizedError | IdentityMismatchError | RequestedOrganizationError

Schema: `UnauthorizedError | IdentityMismatchError | RequestedOrganizationError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `$ (UnauthorizedError)._tag` | `string` | Yes |  |
| `$ (UnauthorizedError).entity` | `string` | Yes |  |
| `$ (UnauthorizedError).action` | `string` | Yes |  |
| `$ (IdentityMismatchError)._tag` | `string` | Yes |  |
| `$ (RequestedOrganizationError)._tag` | `string` | Yes |  |
| `$ (RequestedOrganizationError).reason` | `string \| null` | Yes |  |

Example:

```json
{
  "_tag": "UnauthorizedError",
  "entity": "string",
  "action": "string"
}
```

### `429` (`application/json`)

RateLimitExceededError

Schema: `RateLimitExceededError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |
| `resource` | `string` | Yes | Rate-limited resource bucket the request was counted against. |
| `retryAfter` | `number` | Yes |  |

Example:

```json
{
  "_tag": "RateLimitExceededError",
  "resource": "string",
  "retryAfter": 1
}
```

### `500` (`application/json`)

InternalError

Schema: `InternalError`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `_tag` | `string` | Yes |  |

Example:

```json
{
  "_tag": "InternalError"
}
```

## Example Request

### cURL

```bash
curl -X GET 'https://api.thecompany.company/v1/environments' \
  -H 'Authorization: Bearer <TOKEN>'
```

### TypeScript

```typescript
const response = await fetch('https://api.thecompany.company/v1/environments', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
  },
});
if (!response.ok) {
  throw new Error('HTTP ' + response.status);
}
const data = await response.json();
```
