v14

latestOpenAPI 3.0.32026-08-04377889.4 MB
environment

Updates one or more shared environment variables

Updates a given Shared Environment Variable for a Team.

patch/v1/env

Query parameters

teamIdstring
Example:team_1a2b3c4d5e6f7g8h9i0j1k2l

The Team identifier to perform the request on behalf of.

slugstring
Example:my-team-url-slug

The Team slug to perform the request on behalf of.

Request body

updatesobject required

An object where each key is an environment variable ID (not the key name) and the value is the update to apply

Example request

{
  "updates": {
    "env_2WjyKQmM8ZnGcJsPWMrHRHrE": {
      "key": "API_URL",
      "value": "https://api.vercel.com",
      "target": [
        "production",
        "preview"
      ],
      "projectIdUpdates": {
        "link": [
          "prj_2WjyKQmM8ZnGcJsPWMrHRHrE"
        ]
      }
    }
  }
}

Response

Example response

{
  "updated": [
    {
      "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,
      "projectId": [
        "prj_2WjyKQmM8ZnGcJsPWMrHRHrE",
        "prj_2WjyKQmM8ZnGcJsPWMrasEFg"
      ],
      "type": "encrypted",
      "target": [
        "production"
      ]
    }
  ]
}