> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Environment Variable

> Deletes an environment variable specified by name. The variable is automatically undeployed from all environments.

## Endpoint

```plaintext theme={null}
DELETE /apiops/projects/{projectName}/environmentVariables/{name}/
```

## Authentication

Requires a Personal API Access Token.

### Header

```plaintext theme={null}
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value          | Required |
| ------------- | -------------- | -------- |
| Authorization | Bearer {token} | Yes      |

### Path Parameters

| Parameter   | Type   | Required | Description                                     |
| ----------- | ------ | -------- | ----------------------------------------------- |
| projectName | string | Yes      | Project name (can be "admin" for admin project) |
| name        | string | Yes      | Environment variable name                       |

### Request Body

None.

## Response

### Success Response (200 OK)

```json theme={null}
{
  "status": "SUCCESS",
  "deploymentResult": {
    "success": true,
    "responseTime": 1500,
    "detailList": [
      {
        "envName": "production",
        "success": true,
        "detail": "Undeployed successfully",
        "responseTime": 450
      }
    ],
    "firstFromApiResultList": {
      "envName": "production",
      "success": true,
      "detail": "Undeployed successfully",
      "responseTime": 450
    }
  }
}
```

### Error Response (400 Bad Request)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "Environment variable (name: API_BASE_URL) was not found!"
}
```

## cURL Example

```bash theme={null}
curl -X DELETE \
  "https://demo.apinizer.com/apiops/projects/MyProject/environmentVariables/API_BASE_URL/" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Permissions

* User must have **`SECRETS` + `MANAGE`** permission in the project

## Notes and Warnings

* **Permanent Deletion**:
  * Environment variable is permanently deleted
  * This action cannot be undone

* **Automatic Undeployment**:
  * Variable is automatically undeployed from all environments
  * Undeployment results are returned in the response

## Related Documentation

* [List Environment Variables](/api-reference/environment-variables/crud/list-environment-variables) - List all environment variables
* [Create Environment Variable](/api-reference/environment-variables/crud/create-environment-variable) - Create a new environment variable
