
# Get the current environment

`GET /v1/environment` · permission `environment-settings:read`

Returns the environment that the calling credential belongs to: its ID, type, region, cell, state and plan. The environment always comes from the credential; this endpoint cannot read another environment. The endpoint is read-only and available on every plan. The OpenTofu/Terraform data source `keenauth_environment` reads it.

## Request

No parameters.

## Response

`200 OK`

```json
{
  "id": "env_01h455vb4pex5vsknk084sn02q",
  "type": "production",
  "region": "eu",
  "cell_id": "eu1",
  "state": "active",
  "plan": "business"
}
```

| Field | Description |
|---|---|
| `id` | Environment ID (`env_…`). |
| `type` | `development`, `staging` or `production`. It never changes. |
| `region` | Data region (`eu`, `us`). The management API host is `api.<region>.keenauth.com`. |
| `cell_id` | Cell that serves the environment, for example `eu1`. |
| `state` | `active`, `suspended_dashboard`, `suspended_nonprod`, `export_only` or `deleting`. |
| `plan` | `free`, `startup`, `business`, `enterprise` or `internal`; `null` until the plan has reached the cell. Do not assume a plan when it is `null`. |

This version does not return the display name, creation time, default host or custom domains. `GET /v1/custom-domains` lists the custom domains.

## Errors

| HTTP | code | When |
|---|---|---|
| 403 | `insufficient_permissions` | The credential lacks `environment-settings:read`. |
| 503 | `service_unavailable` | The environment registry could not be read; retry later. |

## Example

```bash
curl -i https://api.eu.keenauth.com/v1/environment \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY"
```

CLI: `keenauth environment get`
