Create one or more shared environment variables
POST
/__remote/api.vercel.com/v1/envCreates shared environment variable(s) for a team.
Request
import { Edgenivo } from "@vercel/sdk";
const vercel = new Edgenivo({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.environment.createSharedEnvVariable({ teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", requestBody: { evs: [], type: "encrypted", target: [ "production", "preview", ], }, });
console.log(result);}
run();Response
{ "created": [ { "applyToAllCustomEnvironments": "false", "comment": "string", "created": "2021-02-10T13:11:49.180Z", "createdAt": "1609492210000", "createdBy": "2qDDuGFTWXBLDNnqZfWPDp1A", "customEnvironmentIds": [], "decrypted": "false", "deletedAt": "1609492210000", "deletedBy": "2qDDuGFTWXBLDNnqZfWPDp1A", "id": "env_XCG7t7AIHuO2SBA8667zNUiM", "key": "my-api-key", "lastEditedByDisplayName": "Example Name", "lastEditedByPrincipal": { "avatar": "string", "id": "icfg_1234567890", "name": "Example Name", "type": "user", "username": "string" }, "ownerId": "team_LLHUOMOoDlqOp8wPE4kFo9pE", "projectId": [], "target": [], "type": "encrypted", "updatedAt": "1609492210000", "updatedBy": "2qDDuGFTWXBLDNnqZfWPDp1A", "value": "string" } ], "failed": [ { "error": { "action": "string", "code": "string", "envVarId": "example_id", "envVarKey": "string", "gitBranch": "string", "key": "string", "link": "string", "message": "string", "project": "string", "target": [], "value": "string" } } ]}AuthorizationbearerToken
Default authentication mechanism