---
title: "Retrieve the environment variables of a project by id or name"
method: GET
path: "/v10/projects/{idOrName}/env"
tags: ["projects"]
---

# Retrieve the environment variables of a project by id or name

`GET /v10/projects/{idOrName}/env`

Retrieve the environment variables for a given project by passing either the project `id` or `name` in the URL.

## Path parameters

- `idOrName` string, required — The unique project identifier or the project name

## Query parameters

- `gitBranch` string — If defined, the git branch of the environment variable to filter the results (must have target=preview)
- `decrypt` 'true' | 'false' — If true, the environment variable value will be decrypted
- `source` string — The source that is calling the endpoint.
- `customEnvironmentId` string — The unique custom environment identifier within the project
- `customEnvironmentSlug` string — The custom environment slug (name) within the project
- `teamId` string
- `slug` string

## Response `200`

The list of environment variables for the given project

- union
  - object
    - `target` union
      - string[]
      - 'development' | 'development' | 'preview' | 'preview' | 'production'
    - `type` 'encrypted' | 'plain' | 'secret' | 'sensitive' | 'system', required
    - `sunsetSecretId` string — This is used to identify variables that have been migrated from type secret to sensitive.
    - `legacyValue` string — Legacy now-encryption ciphertext, present after migration swaps value/vsmValue
    - `decrypted` false | true
    - `value` string, required
    - `vsmValue` string
    - `id` string
    - `key` string, required
    - `configurationId` string, nullable
    - `createdAt` number
    - `updatedAt` number
    - `createdBy` string, nullable
    - `updatedBy` string, nullable
    - `gitBranch` string
    - `visibility` 'config' | 'secret' — User-facing config/secret model. When set, authoritative for new code paths when the env-var-config-secret-ui flag is enabled. Legacy rows omit this field; legacy rows omit it and callers fall back to existing `type` behavior.
    - `edgeConfigId` string, nullable
    - `edgeConfigTokenId` string, nullable
    - `contentHint` union
      - object
        - `type` 'redis-url', required
        - `storeId` string, required
      - object
        - `type` 'redis-rest-api-url', required
        - `storeId` string, required
      - object
        - `type` 'redis-rest-api-token', required
        - `storeId` string, required
      - object
        - `type` 'redis-rest-api-read-only-token', required
        - `storeId` string, required
      - object
        - `type` 'blob-read-write-token', required
        - `storeId` string, required
      - object
        - `type` 'blob-store-id', required
        - `storeId` string, required
      - object
        - `type` 'blob-webhook-public-key', required
        - `storeId` string, required
      - object
        - `type` 'postgres-url', required
        - `storeId` string, required
      - object
        - `type` 'postgres-url-non-pooling', required
        - `storeId` string, required
      - object
        - `type` 'postgres-prisma-url', required
        - `storeId` string, required
      - object
        - `type` 'postgres-user', required
        - `storeId` string, required
      - object
        - `type` 'postgres-host', required
        - `storeId` string, required
      - object
        - `type` 'postgres-password', required
        - `storeId` string, required
      - object
        - `type` 'postgres-database', required
        - `storeId` string, required
      - object
        - `type` 'postgres-url-no-ssl', required
        - `storeId` string, required
      - object
        - `type` 'integration-store-secret', required
        - `storeId` string, required
        - `integrationId` string, required
        - `integrationProductId` string, required
        - `integrationConfigurationId` string, required
      - object
        - `type` 'flags-connection-string', required
        - `projectId` string, required
    - `internalContentHint` object, nullable — Similar to `contentHints`, but should not be exposed to the user.
      - `type` 'flags-secret', required
      - `encryptedValue` string, required — Contains the `value` of the env variable, encrypted with a special key to make decryption possible in the subscriber Lambda.
    - `comment` string
    - `customEnvironmentIds` string[]
    - `system` false | true
  - object
    - `envs` object[], required
      - `target` union
        - string[]
        - 'development' | 'development' | 'preview' | 'preview' | 'production'
      - `type` 'encrypted' | 'plain' | 'secret' | 'sensitive' | 'system', required
      - `sunsetSecretId` string — This is used to identify variables that have been migrated from type secret to sensitive.
      - `legacyValue` string — Legacy now-encryption ciphertext, present after migration swaps value/vsmValue
      - `decrypted` false | true
      - `value` string, required
      - `vsmValue` string
      - `id` string
      - `key` string, required
      - `configurationId` string, nullable
      - `createdAt` number
      - `updatedAt` number
      - `createdBy` string, nullable
      - `updatedBy` string, nullable
      - `gitBranch` string
      - `visibility` 'config' | 'secret' — User-facing config/secret model. When set, authoritative for new code paths when the env-var-config-secret-ui flag is enabled. Legacy rows omit this field; legacy rows omit it and callers fall back to existing `type` behavior.
      - `edgeConfigId` string, nullable
      - `edgeConfigTokenId` string, nullable
      - `contentHint` union
        - object
          - `type` 'redis-url', required
          - `storeId` string, required
        - object
          - `type` 'redis-rest-api-url', required
          - `storeId` string, required
        - object
          - `type` 'redis-rest-api-token', required
          - `storeId` string, required
        - object
          - `type` 'redis-rest-api-read-only-token', required
          - `storeId` string, required
        - object
          - `type` 'blob-read-write-token', required
          - `storeId` string, required
        - object
          - `type` 'blob-store-id', required
          - `storeId` string, required
        - object
          - `type` 'blob-webhook-public-key', required
          - `storeId` string, required
        - object
          - `type` 'postgres-url', required
          - `storeId` string, required
        - object
          - `type` 'postgres-url-non-pooling', required
          - `storeId` string, required
        - object
          - `type` 'postgres-prisma-url', required
          - `storeId` string, required
        - object
          - `type` 'postgres-user', required
          - `storeId` string, required
        - object
          - `type` 'postgres-host', required
          - `storeId` string, required
        - object
          - `type` 'postgres-password', required
          - `storeId` string, required
        - object
          - `type` 'postgres-database', required
          - `storeId` string, required
        - object
          - `type` 'postgres-url-no-ssl', required
          - `storeId` string, required
        - object
          - `type` 'integration-store-secret', required
          - `storeId` string, required
          - `integrationId` string, required
          - `integrationProductId` string, required
          - `integrationConfigurationId` string, required
        - object
          - `type` 'flags-connection-string', required
          - `projectId` string, required
      - `internalContentHint` object, nullable — Similar to `contentHints`, but should not be exposed to the user.
        - `type` 'flags-secret', required
        - `encryptedValue` string, required — Contains the `value` of the env variable, encrypted with a special key to make decryption possible in the subscriber Lambda.
      - `comment` string
      - `customEnvironmentIds` string[]
      - `system` false | true
    - `pagination` Pagination, required — This object contains information related to the pagination of the current request, including the necessary parameters to get the next or previous page of data.
      - `count` number, required — Amount of items in the current page.
      - `next` number, nullable, required — Timestamp that must be used to request the next page.
      - `prev` number, nullable, required — Timestamp that must be used to request the previous page.
  - object — The list of environment variables for the given project
    - `envs` object[], required
      - `target` union
        - string[]
        - 'development' | 'development' | 'preview' | 'preview' | 'production'
      - `type` 'encrypted' | 'plain' | 'secret' | 'sensitive' | 'system', required
      - `sunsetSecretId` string — This is used to identify variables that have been migrated from type secret to sensitive.
      - `legacyValue` string — Legacy now-encryption ciphertext, present after migration swaps value/vsmValue
      - `decrypted` false | true
      - `value` string, required
      - `vsmValue` string
      - `id` string
      - `key` string, required
      - `configurationId` string, nullable
      - `createdAt` number
      - `updatedAt` number
      - `createdBy` string, nullable
      - `updatedBy` string, nullable
      - `gitBranch` string
      - `visibility` 'config' | 'secret' — User-facing config/secret model. When set, authoritative for new code paths when the env-var-config-secret-ui flag is enabled. Legacy rows omit this field; legacy rows omit it and callers fall back to existing `type` behavior.
      - `edgeConfigId` string, nullable
      - `edgeConfigTokenId` string, nullable
      - `contentHint` union
        - object
          - `type` 'redis-url', required
          - `storeId` string, required
        - object
          - `type` 'redis-rest-api-url', required
          - `storeId` string, required
        - object
          - `type` 'redis-rest-api-token', required
          - `storeId` string, required
        - object
          - `type` 'redis-rest-api-read-only-token', required
          - `storeId` string, required
        - object
          - `type` 'blob-read-write-token', required
          - `storeId` string, required
        - object
          - `type` 'blob-store-id', required
          - `storeId` string, required
        - object
          - `type` 'blob-webhook-public-key', required
          - `storeId` string, required
        - object
          - `type` 'postgres-url', required
          - `storeId` string, required
        - object
          - `type` 'postgres-url-non-pooling', required
          - `storeId` string, required
        - object
          - `type` 'postgres-prisma-url', required
          - `storeId` string, required
        - object
          - `type` 'postgres-user', required
          - `storeId` string, required
        - object
          - `type` 'postgres-host', required
          - `storeId` string, required
        - object
          - `type` 'postgres-password', required
          - `storeId` string, required
        - object
          - `type` 'postgres-database', required
          - `storeId` string, required
        - object
          - `type` 'postgres-url-no-ssl', required
          - `storeId` string, required
        - object
          - `type` 'integration-store-secret', required
          - `storeId` string, required
          - `integrationId` string, required
          - `integrationProductId` string, required
          - `integrationConfigurationId` string, required
        - object
          - `type` 'flags-connection-string', required
          - `projectId` string, required
      - `internalContentHint` object, nullable — Similar to `contentHints`, but should not be exposed to the user.
        - `type` 'flags-secret', required
        - `encryptedValue` string, required — Contains the `value` of the env variable, encrypted with a special key to make decryption possible in the subscriber Lambda.
      - `comment` string
      - `customEnvironmentIds` string[]
      - `system` false | true
    - `hiddenProductionEnvCount` number, required

## Other responses

- `400` — One of the provided values in the request query is invalid.
- `401` — The request is not authorized.
- `403` — You do not have permission to access this resource.
- `410`

---

[API](https://skmtc.net/vercel/apis/api.md) · [All operations](https://skmtc.net/vercel/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vercel/api/versions/b4d86a3e3479/schema)
