---
title: "PUT /v2/vals/{val_id}/environment_variables/{key}"
method: PUT
path: "/v2/vals/{val_id}/environment_variables/{key}"
tags: ["vals"]
---

# PUT /v2/vals/{val_id}/environment_variables/{key}

`PUT /v2/vals/{val_id}/environment_variables/{key}`

Update a environment variable scoped to this project.

## Path parameters

- `val_id` string, uuid, required
- `key` string, required

## Request body

- object — Inputs to update a environment variable
  - `value` string, required — Value of the environment variable.
  - `description` string, nullable — Optional description of the environment variable. Send null to clear an existing description; omit it to leave the description unchanged.

## Response `201`

An environment variable

- TEnvironmentVariable — An environment variable
  - `key` string, required — Name or key of the environment variable, accessible via Deno.env or process.env
  - `description` string, nullable, required — Optional description of the environment variable
  - `updatedAt` string, date-time, nullable, required
  - `createdAt` string, date-time, required

---

[API](https://skmtc.net/val-town/apis/val-town-api.md) · [All operations](https://skmtc.net/val-town/apis/val-town-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/val-town/val-town-api/versions/4d8b6d2e6db3/schema)
