Skip to main content
GET
/
v1
/
env
listSharedEnvVariable
import { Vercel } from "@vercel/sdk";

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

async function run() {
  const result = await vercel.environment.listSharedEnvVariable({
    projectId: "prj_2WjyKQmM8ZnGcJsPWMrHRHrE",
    ids: "env_2WjyKQmM8ZnGcJsPWMrHRHrE,env_2WjyKQmM8ZnGcJsPWMrHRCRV",
    excludeIdsQueryParameter: "env_2WjyKQmM8ZnGcJsPWMrHRHrE,env_2WjyKQmM8ZnGcJsPWMrHRCRV",
    excludeIdsQueryParameter1: "env_2WjyKQmM8ZnGcJsPWMrHRHrE,env_2WjyKQmM8ZnGcJsPWMrHRCRV",
    excludeProjectIdQueryParameter: "prj_2WjyKQmM8ZnGcJsPWMrHRHrE",
    excludeProjectIdQueryParameter1: "prj_2WjyKQmM8ZnGcJsPWMrHRHrE",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();
{
  "data": [
    {
      "created": "2021-02-10T13:11:49.180Z",
      "key": "my-api-key",
      "ownerId": "team_LLHUOMOoDlqOp8wPE4kFo9pE",
      "id": "env_XCG7t7AIHuO2SBA8667zNUiM",
      "createdBy": "2qDDuGFTWXBLDNnqZfWPDp1A",
      "deletedBy": "2qDDuGFTWXBLDNnqZfWPDp1A",
      "updatedBy": "2qDDuGFTWXBLDNnqZfWPDp1A",
      "createdAt": 1609492210000,
      "deletedAt": 1609492210000,
      "updatedAt": 1609492210000,
      "value": "<string>",
      "projectId": [
        "prj_2WjyKQmM8ZnGcJsPWMrHRHrE",
        "prj_2WjyKQmM8ZnGcJsPWMrasEFg"
      ],
      "type": "encrypted",
      "target": "production",
      "applyToAllCustomEnvironments": true,
      "decrypted": true,
      "comment": "<string>",
      "lastEditedByDisplayName": "<string>"
    }
  ],
  "pagination": {
    "count": 20,
    "next": 1540095775951,
    "prev": 1540095775951
  }
}

Authorizations

Authorization
string
header
required

Default authentication mechanism

Query Parameters

projectId
string

Filter SharedEnvVariables that belong to a project

Example:

"prj_2WjyKQmM8ZnGcJsPWMrHRHrE"

ids
string

Filter SharedEnvVariables based on comma separated ids

Example:

"env_2WjyKQmM8ZnGcJsPWMrHRHrE,env_2WjyKQmM8ZnGcJsPWMrHRCRV"

exclude_ids
string

Filter SharedEnvVariables based on comma separated ids

Example:

"env_2WjyKQmM8ZnGcJsPWMrHRHrE,env_2WjyKQmM8ZnGcJsPWMrHRCRV"

exclude-ids
string

Filter SharedEnvVariables based on comma separated ids

Example:

"env_2WjyKQmM8ZnGcJsPWMrHRHrE,env_2WjyKQmM8ZnGcJsPWMrHRCRV"

exclude_projectId
string

Filter SharedEnvVariables that belong to a project

Example:

"prj_2WjyKQmM8ZnGcJsPWMrHRHrE"

exclude-projectId
string

Filter SharedEnvVariables that belong to a project

Example:

"prj_2WjyKQmM8ZnGcJsPWMrHRHrE"

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

data
object[]
required
pagination
object
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.

I