Skip to content
Docs

Remove an environment variable

DELhttps://api.vercel.com/v9/projects/{idOrName}/env/{id}
Delete a specific environment variable for a given project by passing the environment variable identifier and either passing the project id or name in the URL.
https://api.vercel.com/v9/projects/{idOrName}/env/{id}
const response = await fetch('https://api.vercel.com/v9/projects/idOrName/env/id?customEnvironmentId=string&teamId=string&slug=string', {
method: 'DELETE',
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",
"internalContentHint": {
"encryptedValue": "string",
"type": "flags-secret"
},
"key": "string",
"legacyValue": "string",
"sunsetSecretId": "example_id",
"target": [],
"type": "encrypted",
"updatedAt": "123",
"updatedBy": "string",
"value": "string",
"visibility": "config"
}
]
AuthorizationbearerToken

Default authentication mechanism

idOrNamestringRequired
The unique project identifier or the project name
idstringRequired
The unique environment variable identifier
customEnvironmentIdstringOptional
The unique custom environment identifier within the project
teamIdstringOptional
The Team identifier to perform the request on behalf of.
slugstringOptional
The Team slug to perform the request on behalf of.
200The environment variable was successfully removed
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
409The project is being transfered and removing an environment variable is not possible
410Error