---
title: "Update env file"
method: PUT
path: "/api/stacks/{stackName}/env"
tags: ["Stacks"]
---

# Update env file

`PUT /api/stacks/{stackName}/env`

Overwrites an environment file's content. Requires `stack:edit` permission.

## Path parameters

- `stackName` string, required

## Query parameters

- `file` string

## Headers

- `x-node-id` integer

## Request body

- object
  - `content` string, required — Full env file content (KEY=VALUE format).

## Response `200`

Env file saved.

- SuccessMessage
  - `message` string, required

## Other responses

- `400` — Invalid input.
- `403` — Insufficient permissions or license tier.
- `500` — Internal server error.

## Changes

- **2026-04-05** `7464894ea582` — 3 warning, 3 info
  - added the new `PAID_REQUIRED` enum value to the `code` response property for the response status `400`
  - added the new `PAID_REQUIRED` enum value to the `code` response property for the response status `403`
  - added the new `PAID_REQUIRED` enum value to the `code` response property for the response status `500`
  - removed the `PRO_REQUIRED` enum value from the `code` response property for the response status `400`
  - …2 more
- **2026-04-01** `c62bbceae824` — 1 breaking
  - added the pattern `^[a-zA-Z0-9_-]+$` to the `path` request parameter `stackName`

[Change history](https://skmtc.dev/studio-saelix/apis/sencho-api/changes/api/stacks/:stackName/env/put.md)

---

[API](https://skmtc.dev/studio-saelix/apis/sencho-api.md) · [All operations](https://skmtc.dev/studio-saelix/apis/sencho-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/studio-saelix/sencho-api/revisions/6aa88c4c8a4f/schema)
