---
title: "Update environment variable"
method: PATCH
path: "/v1/vaults/{vault_id}/env-vars/{key}"
tags: ["Environment Variables"]
---

# Update environment variable

`PATCH /v1/vaults/{vault_id}/env-vars/{key}`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/vaults/{vault_id}/env-vars/{key}`
- Auth: HTTP bearer

## Path parameters

- `vault_id` string, uuid, required
- `key` string, required

## Query parameters

- `environment` string

## Request body

- UpdateEnvVarRequest
  - `value` string
  - `environments` string[]
  - `sensitive` boolean
  - `comment` string

## Response `200`

Environment variable updated

- EnvVar
  - `id` string, uuid
  - `key` string
  - `environments` string[]
  - `git_branch` string, nullable
  - `sensitive` boolean
  - `comment` string, nullable
  - `value` string, nullable: Null for sensitive vars in list responses
  - `version` integer
  - `created_by` string, nullable
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `404`: Resource not found

---

[API](https://skmtc.dev/1claw/apis/1claw-api.md) · [All operations](https://skmtc.dev/1claw/apis/1claw-api/llms.txt) · [OpenAPI document](https://skmtc.dev/1claw/apis/1claw-api/revisions/ae109b496830?raw)
