---
title: "Get environment variables for a project, optionally filtered by environment"
method: GET
path: "/projects/{project_id}/env-vars"
tags: ["Projects"]
---

# Get environment variables for a project, optionally filtered by environment

`GET /projects/{project_id}/env-vars`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/projects/{project_id}/env-vars`
- Auth: HTTP bearer

## Path parameters

- `project_id` integer, required

## Query parameters

- `environment_id` integer

## Response `200`

List of environment variables

- EnvironmentVariableResponse[]
  - `created_at` string, date-time, required
  - `environments` EnvironmentInfo[], required
    - `current_deployment_id` integer, nullable
    - `id` integer, required
    - `main_url` string, required
    - `name` string, required
  - `id` integer, required
  - `include_in_preview` boolean, required: Include this environment variable in preview environments
  - `is_secret` boolean, required: Whether the stored value is write-only. Marked secrets always have `value: None` in API responses and cannot be revealed.
  - `key` string, required
  - `secret_suggestion` SecretSuggestionResponse, nullable: Why a regular environment variable should probably be a secret.
    - `message` string, required: One sentence for the operator, e.g. "DATABASE_URL contains a password in its connection string".
    - `reason` 'connection_string_password' | 'private_key' | 'provider_token' | 'json_web_token' | 'credential_name', required: Why a regular variable looks like it holds a credential.
  - `updated_at` string, date-time, required
  - `value` string, nullable: Plaintext for regular variables in create/update responses, or `"***"` in list responses. Always `None` for marked secrets. Only regular variables can be read through the audited per-variable reveal endpoint.

## Other responses

- `404`: Project not found
- `500`: Internal server error

## Changes

- **2026-11-26** `e1864d950604`: 2 breaking
  - the `items/created_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
  - the `items/updated_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
- **2026-11-25** `480a86944327`: 1 info
  - the endpoint scheme security `bearer_auth` was added to the API
- **2026-11-01** `d73a147552a5`: 1 info
  - added the optional property `items/secret_suggestion` to the response with the `200` status
- **2026-05-30** `b72341d12f63`: 2 breaking, 1 info
  - the response property `items/value` became nullable for the status `200`
  - the response property `items/value` became optional for the status `200`
  - added the required property `items/is_secret` to the response with the `200` status

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/projects/:project_id/env-vars/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
