environments
List environment variables
Retrieve the environment variables for an environment.
Identify the environment by its project, app, and environment identifiers. Results are ordered by variable id and paginated; when hasMore is true, pass the returned cursor to fetch the next page.
recoverable variables are returned with their decrypted plaintext value. writeonly variables never expose a value: only the key, kind, and description are returned.
Required Permissions
Your root key must have one of the following permissions:
- environment.*.read_environment_variables (for any environment)
- environment.<environment_id>.read_environment_variables (for a specific environment)
post/v2/environments.listEnvironmentVariables
Request body
Example request
{
"project": "proj_1234abcd",
"app": "proj_1234abcd",
"environment": "proj_1234abcd"
}Response
Successfully retrieved a page of environment variables.
Example response
{
"meta": {
"requestId": "req_123"
},
"data": [
{
"key": "DATABASE_URL",
"kind": "writeonly",
"value": "postgresql://user:pass@host:5432/db",
"description": "Primary database connection string",
"createdAt": 1704067200000
}
],
"pagination": {
"cursor": "eyJrZXkiOiJrZXlfMTIzNCIsInRzIjoxNjk5Mzc4ODAwfQ==",
"hasMore": true
}
}