---
title: "Delete an environment variable"
method: DELETE
path: "/api/v1/apps/{appId}/env/{key}"
tags: ["Apps"]
---

# Delete an environment variable

`DELETE /api/v1/apps/{appId}/env/{key}`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/apps/{appId}/env/{key}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Removes one environment variable's value from the given environment (pass ?target=production|preview|development; omit to remove from all). Deleting a value that does not exist succeeds with requiresRedeploy=false. When a value is removed, changes apply on the next deployment; trigger a redeploy to make them live.

## Path parameters

- `appId` string, required
- `key` string, required

## Query parameters

- `target` 'production' | 'preview' | 'development'

## Response `200`

The variable was removed (requiresRedeploy=true) or did not exist (requiresRedeploy=false).

- object
  - `requiresRedeploy` boolean, required

## Other responses

- `401`: Authentication is missing or invalid.
- `404`: The resource was not found.
- `409`: Response.
- `429`: Too many requests; retry after the indicated delay.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
