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

# PUT /v2/vals/{val_id}/environment_variable_groups/{group_id}

`PUT /v2/vals/{val_id}/environment_variable_groups/{group_id}`

Attach an environment variable group to this val. Every variable in the group is injected into the val's environment. Variables defined on the val itself take precedence over variables with the same key in a group. Attaching a group that is already attached succeeds without doing anything.

## Path parameters

- `val_id` string, uuid, required
- `group_id` string, uuid, required

## Response `204`

The group is attached to the val

## Other responses

- `404` — Val or environment variable group not found in your organization

## Changes

- **2026-08-05** `4d8b6d2e6db3` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/val-town/apis/val-town-api/changes/v2/vals/:val_id/environment_variable_groups/:group_id/put.md)

---

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