Skip to content
Docs

Retrieve the decrypted value of a Shared Environment Variable by id.

GEThttps://api.vercel.com/v1/env/{id}
Retrieve the decrypted value of a Shared Environment Variable by id.
Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.environment.getSharedEnvVar({
id: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
console.log(result);
}
run();
Response
{
"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"
}
AuthorizationbearerToken

Default authentication mechanism

idstringRequired
The unique ID for the Shared Environment Variable to get the decrypted value.
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200Success
applyToAllCustomEnvironmentsbooleanOptional
whether or not this env varible applies to custom environments
commentstringOptional
A user provided comment that describes what this Shared Env Var is for.
createdstringOptional
The date when the Shared Env Var was created.
createdAtnumberOptional
Timestamp for when the Shared Env Var was created.
createdBystringOptional
The unique identifier of the user who created the Shared Env Var.
customEnvironmentIdsarrayOptional
The custom environment IDs that this Shared Env Var is scoped to.
decryptedbooleanOptional
whether or not this env variable is decrypted
deletedAtnumberOptional
Timestamp for when the Shared Env Var was (soft) deleted.
deletedBystringOptional
The unique identifier of the user who deleted the Shared Env Var.
idstringOptional
The unique identifier of the Shared Env Var.
keystringOptional
The name of the Shared Env Var.
lastEditedByDisplayNamestringOptional
The last editor full name or username.
lastEditedByPrincipalobjectOptional2 variants
ownerIdstringOptional
The unique identifier of the owner (team) the Shared Env Var was created for.
projectIdarrayOptional
The unique identifiers of the projects which the Shared Env Var is linked to.
targetarrayOptional
environments this env variable targets
typestringOptional
The type of this cosmos doc instance, if blank, assume secret.
updatedAtnumberOptional
Timestamp for when the Shared Env Var was last updated.
updatedBystringOptional
The unique identifier of the user who last updated the Shared Env Var.
valuestringOptional
The value of the Shared Env Var.
400One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error