# Get environments

`GET /v1/organizations/{organizationId}/environments`

Available as MCP tool `get-environments` (Read).

Environment endpoints allow you to manage environments in your Redox organization.  

Currently, you can retrieve details for any environment(s) you're a member of.

### Get environments

Retrieve a list of environments that you're a member of. You can use this query to find environment IDs. 

The response contains the details for each configured environment.

## Request parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `organizationId` | path | string | Yes | Identifies the Redox organization that you're operating in or on behalf of. |

## Request example

```bash
curl 'https://api.redoxengine.com/platform/v1/organizations/{organizationId}/environments' \
--request GET \
--header 'Authorization: Bearer $API_TOKEN' \
--header 'accept: application/json'
```

## Responses

### 200

Contains a payload object with a list of all environments the user has permissions to in the specified organization.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `meta` | object | No |  |
| `meta.version` | string | No | Lists the major and minor version number for the format of the returned payload. The payload format or shape may change between minor versions, like including additional or extended fields in later versions. We include the version data in each response so that you have the option to handle the signaled differences. |
| `payload` | object | No | Contains the payload with details about the requested environment(s). |
| `payload.environments` | Array of object | No | Contains an array of environments. |
| `payload.environments[].id` | string | No | Identifies the specific environment that you're operating in or on behalf of. |
| `payload.environments[].name` | string | No | Displays the human readable name of the environment. |
| `payload.environments[].environmentFlag` | string | No | Indicates whether the environment is used for development, staging, or production. Possible values: Production, Staging, Development |
| `payload.environments[].organization` | object | No | Contains metadata about the Redox organization. |
| `payload.environments[].organization.id` | number | No | Contains the unique identifier of the Redox organization. |

_Generated from the schema: the values are placeholders, not a real payload._

```json
{
  "meta": {
    "version": "1.0.0"
  },
  "payload": {
    "environments": [
      {
        "id": "string",
        "name": "string",
        "environmentFlag": "Staging",
        "organization": {
          "id": 122
        }
      }
    ]
  }
}
```

### 400

Bad Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.id` | string | No | Contains a unique identifier for the given error instance. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Bad Request`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Bad Request",
      "code": "validation.error.bad.request",
      "detail": "Error details",
      "status": 400,
      "transient": false
    }
  }
}
```

### 403

Forbidden

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.errors` | Array of object | No |  |
| `payload.errors[].title` | string | No | Displays the high-level error message, typically something succinct like `Forbidden`. |
| `payload.errors[].code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |

```json
{
  "payload": {
    "errors": [
      {
        "title": "Forbidden",
        "code": "authorization.forbidden"
      }
    ]
  }
}
```

### 500

Internal Server Error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payload` | object | No | Contains the error message. |
| `payload.error` | object | No | Contains the error message details. |
| `payload.error.title` | string | No | Displays the high-level error message, typically something succinct like `Failed in step X`. |
| `payload.error.code` | string | No | Contains an alternative ID for the error type, which can be used to find relevant troubleshooting information. |
| `payload.error.detail` | string | No | Contains the specific error details for this message. |
| `payload.error.status` | number | No | Displays the corresponding HTTP status code for the error. |
| `payload.error.transient` | boolean | No | Describes whether the error will resolve itself. If `true`, no further action needs to be taken. If `false`, you may need to troubleshoot on your end to resolve the issue before the error can be processed. |

```json
{
  "payload": {
    "error": {
      "title": "Internal Server Error",
      "code": "failed.db.lookup",
      "detail": "Error details",
      "status": 500,
      "transient": true
    }
  }
}
```
