Skip to main content

Overview

Returns all environment variables for a specific project and environment. When called from inside a task, the projectRef and env arguments can be omitted and are inferred automatically from the task’s runtime context. Supports both secret key and Personal Access Token authentication.

Endpoint

Path parameters

string
required
The project reference (e.g. proj_yubjwjsfkxnylobaqvqz). Find it in your dashboard URL or project settings.
string
required
The target environment: dev, staging, prod, or preview.

Response

Returns an array of environment variable objects.
string
The name of the environment variable (e.g. SLACK_API_KEY).
string
The value of the environment variable.

Examples

Response example

Preview branches

When listing env vars for the preview environment and you want to target a specific branch, include the x-trigger-branch header (HTTP) or the previewBranch SDK option.