Retrieve the decrypted value of an environment variable of a project by id
GET
https://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
{ "comment": "string", "configurationId": "example_id", "contentHint": { "storeId": "example_id", "type": "redis-url" }, "createdAt": "123", "createdBy": "string", "customEnvironmentIds": [], "decrypted": "false", "edgeConfigId": "example_id", "edgeConfigTokenId": "example_id", "gitBranch": "string", "id": "icfg_1234567890", "key": "string", "sunsetSecretId": "example_id", "target": [], "type": "encrypted", "updatedAt": "123", "updatedBy": "string", "visibility": "config"}AuthorizationbearerToken
Default authentication mechanism
200Success
This is used to identify variables that have been migrated from type secret to sensitive.
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