Skip to content
Docs

Retrieve the decrypted value of an environment variable of a project by id

GEThttps://api.vercel.com/v1/projects/{idOrName}/env/{id}
Retrieve the environment variable for a given project.
https://api.vercel.com/v1/projects/{idOrName}/env/{id}
const response = await fetch('https://api.vercel.com/v1/projects/idOrName/env/id?teamId=string&slug=string', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);
Response
{
"decrypted": "false",
"type": "encrypted",
"edgeConfigId": "example_id",
"edgeConfigTokenId": "example_id",
"createdAt": "123",
"updatedAt": "123",
"id": "icfg_1234567890",
"key": "string",
"target": [],
"gitBranch": "string",
"createdBy": "string",
"updatedBy": "string",
"sunsetSecretId": "example_id",
"legacyValue": "string",
"configurationId": "example_id",
"visibility": "config",
"contentHint": {
"type": "redis-url",
"storeId": "example_id"
},
"internalContentHint": {
"type": "flags-secret",
"encryptedValue": "string"
},
"comment": "string",
"customEnvironmentIds": []
}
AuthorizationbearerToken

Default authentication mechanism

idOrNamestringRequired
The unique project identifier or the project name
idstringRequired
The unique ID for the 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
decryptedbooleanRequired
typestringRequired
edgeConfigIdstringOptional
edgeConfigTokenIdstringOptional
createdAtnumberOptional
updatedAtnumberOptional
idstringOptional
keystringRequired
targetobjectOptional2 variants
gitBranchstringOptional
createdBystringOptional
updatedBystringOptional
sunsetSecretIdstringOptional
This is used to identify variables that have been migrated from type secret to sensitive.
legacyValuestringOptional
Legacy now-encryption ciphertext, present after migration swaps value/vsmValue
configurationIdstringOptional
visibilitystringOptional
User-facing config/secret model. When set, authoritative for new code paths when the env-var-config-secret-ui flag is enabled. Legacy rows omit this field; legacy rows omit it and callers fall back to existing type behavior.
contentHintobjectOptional17 variants
internalContentHintobjectOptional
Similar to contentHints, but should not be exposed to the user.
commentstringOptional
customEnvironmentIdsarrayOptional
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.
410Error