---
title: "Replace the entire set of environment variables"
method: PUT
path: "/v2/apps/{appId}/envs"
tags: ["Environment Variables"]
---

# Replace the entire set of environment variables

`PUT /v2/apps/{appId}/envs`

Replaces the application's environment variables with exactly the set provided in the request body. Variables not listed are removed; pass an empty object to wipe all of them.

Limits: up to 256 variables, each key max 1024 chars, each value max 4096 chars.

Requires the workspace Administrator role (or ownership) when called against a workspace-shared application.

## Path parameters

- `appId` string, required

## Request body

- object
  - `envs` object, required — Complete env set. Replaces all existing variables.

## Response `200`

Environment variables replaced.

- object
  - `status` 'success', required
  - `response` EnvVars, required — Environment variables as an arbitrary `{ key: value }` map of strings.

## Other responses

- `400` — The request failed validation or the environment variables could not be persisted.
- `401` — The Authorization header is missing, malformed, or the credentials are not valid.
- `403` — The workspace member does not have the required permission for this endpoint.
- `404` — The target application could not be found, or the caller is not a member of the workspace.
- `413` — The request body is larger than the maximum allowed size (100MB).
- `429` — The authenticated user or API key exceeded the global request budget.
- `500` — An unexpected error occurred while processing the request.

---

[API](https://skmtc.dev/squarecloud/apis/square-cloud-api.md) · [All operations](https://skmtc.dev/squarecloud/apis/square-cloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/squarecloud/square-cloud-api/revisions/54b7733a6b95/schema)
