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

# List Environments

> Retrieves all environments in the Apinizer system. This endpoint is available only to administrators.

## Endpoint

```
GET /apiops/environments/
```

## Authentication

Requires a Personal API Access Token with admin role.

### Header

```
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value          | Required |
| ------------- | -------------- | -------- |
| Authorization | Bearer {token} | Yes      |

### Path Parameters

None.

### Query Parameters

None.

## Response

### Success Response (200 OK)

```json theme={null}
{
  "success": true,
  "resultList": [
    {
      "name": "production",
      "description": "Production environment",
      "type": "KUBERNETES",
      "accessUrl": "https://gw.example.com",
      "status": "PUBLISHED"
    },
    {
      "name": "staging",
      "description": "Staging environment",
      "type": "KUBERNETES",
      "accessUrl": "https://gw-staging.example.com",
      "status": "PUBLISHED"
    },
    {
      "name": "development",
      "description": "Development environment",
      "type": "STANDALONE",
      "accessUrl": "https://gw-dev.example.com",
      "status": "PUBLISHED"
    }
  ],
  "resultCount": 3
}
```

### Response Fields

| Field       | Type           | Description                             |
| ----------- | -------------- | --------------------------------------- |
| success     | boolean        | Indicates if the request was successful |
| resultList  | array\[object] | List of environments                    |
| resultCount | integer        | Total number of environments            |

### Environment Object

| Field       | Type   | Description                                                   |
| ----------- | ------ | ------------------------------------------------------------- |
| name        | string | Environment name                                              |
| description | string | Environment description (optional)                            |
| type        | string | Environment type (e.g., `KUBERNETES`, `DOCKER`, `STANDALONE`) |
| accessUrl   | string | Gateway access URL for this environment                       |
| status      | string | Publish status (e.g., `PUBLISHED`, `NOT_PUBLISHED`)           |

### Error Response (401 Unauthorized)

```json theme={null}
{
  "error": "unauthorized",
  "error_description": "Admin role required"
}
```

### Error Response (403 Forbidden)

```json theme={null}
{
  "error": "forbidden",
  "error_description": "Insufficient permissions"
}
```

## cURL Example

```bash theme={null}
curl -X GET \
  "https://demo.apinizer.com/apiops/environments/" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Permissions

* User must have **system admin (`sysAdmin`)** role

## Notes and Warnings

* **Admin Only**: This endpoint requires system admin role
* **Regular users should use "Get Environments by Project" endpoint instead**

## Related Documentation

* [Get Environments by Project](/api-reference/environments/get-environments-by-project) - Get environments for a specific project
* [Authentication Guide](/api-reference/getting-started/authentication) - How to obtain and use API tokens
