---
title: "Create environment variable"
method: POST
path: "/applications/v1/projects/{id}/env"
tags: ["Applications Env Vars"]
---

# Create environment variable

`POST /applications/v1/projects/{id}/env`

Create a new environment variable for a project

## Path parameters

- `id` string, required

## Request body

- object
  - `key` string, required — Environment variable name
  - `value` string, required — Environment variable value
  - `target` string[], required — Deployment targets for this variable
  - `type` 'plain' | 'encrypted' | 'secret' — Variable type
  - `gitBranch` string — Specific git branch (for preview deployments)

## Response `200`

Success

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

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