---
title: "getEnvironmentVariable"
method: GET
path: "/v1/environments/{key}"
tags: ["environments"]
---

# getEnvironmentVariable

`GET /v1/environments/{key}`

Get an environment variable by key. Returns value only for String type, omitted for SecretString.

## Response `200`

Environment variable

- EnvironmentVariable
  - `key` string, required
  - `type` 'String' | 'SecretString', required
  - `description` string
  - `group` string — Optional group name for organising variables in the UI
  - `value` string — Value is returned for String type, omitted for SecretString
  - `protected` boolean — Whether the variable is protected from editing
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Environment variable not found
- `500` — Internal server error

---

[API](https://skmtc.dev/epilot/apis/environments-api.md) · [All operations](https://skmtc.dev/epilot/apis/environments-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/epilot/environments-api/revisions/6e9b212bbe77/schema)
