---
title: "Set an environment variable."
method: POST
path: "/v1/env"
tags: ["Environment"]
---

# Set an environment variable.

`POST /v1/env`

## Request

- Base URL: `https://api.scalix.world`
- URL: `https://api.scalix.world/v1/env`
- Auth: HTTP bearer

Creates or updates a single project-level environment variable.

## Request body

- SetEnvBody: Request body for `POST /v1/env` — a single project environment variable. Fields are read by serde + utoipa; the 501-stub handlers ignore the body.
  - `key` string, required
  - `value` string, required
  - `is_secret` boolean, nullable: Store the value as a write-only secret (masked on read).

## Response `200`

Variable created or updated

- EnvVar: A project environment variable (secret values are masked).
  - `id` string, required
  - `key` string, required
  - `value` string, required
  - `is_secret` boolean, required
  - `created_at` string, required
  - `updated_at` string, required

## Other responses

- `401`: Missing or invalid credentials
- `500`: Internal error

---

[API](https://skmtc.dev/scalix/apis/scalix-cloud-api.md) · [All operations](https://skmtc.dev/scalix/apis/scalix-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/scalix/apis/scalix-cloud-api/revisions/2c04ca0a90bb?raw)
