GET
/
v10
/
projects
/
{idOrName}
/
env
import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.projects.filterProjectEnvs({
    idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA",
    gitBranch: "feature-1",
    decrypt: "true",
    source: "vercel-cli:pull",
    customEnvironmentId: "env_123abc4567",
    customEnvironmentSlug: "my-custom-env",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  // Handle the result
  console.log(result);
}

run();
{
  "target": [
    "production"
  ],
  "type": "system",
  "sunsetSecretId": "<string>",
  "decrypted": true,
  "value": "<string>",
  "vsmValue": "<string>",
  "id": "<string>",
  "key": "<string>",
  "configurationId": "<string>",
  "createdAt": 123,
  "updatedAt": 123,
  "createdBy": "<string>",
  "updatedBy": "<string>",
  "gitBranch": "<string>",
  "edgeConfigId": "<string>",
  "edgeConfigTokenId": "<string>",
  "contentHint": {
    "type": "redis-url",
    "storeId": "<string>"
  },
  "internalContentHint": {
    "type": "flags-secret",
    "encryptedValue": "<string>"
  },
  "comment": "<string>",
  "customEnvironmentIds": [
    "<string>"
  ],
  "system": true
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Path Parameters

idOrName
string
required

The unique project identifier or the project name

Example:

"prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA"

Query Parameters

gitBranch
string

If defined, the git branch of the environment variable to filter the results (must have target=preview)

Maximum length: 250
Example:

"feature-1"

decrypt
enum<string>
deprecated

If true, the environment variable value will be decrypted

Available options:
true,
false
Example:

"true"

source
string

The source that is calling the endpoint.

Example:

"vercel-cli:pull"

customEnvironmentId
string

The unique custom environment identifier within the project

Example:

"env_123abc4567"

customEnvironmentSlug
string

The custom environment slug (name) within the project

Example:

"my-custom-env"

teamId
string

The Team identifier to perform the request on behalf of.

Example:

"team_1a2b3c4d5e6f7g8h9i0j1k2l"

slug
string

The Team slug to perform the request on behalf of.

Example:

"my-team-url-slug"

Response

200
application/json
The list of environment variables for the given project

The response is of type object.