---
title: "Create an environment variable"
method: POST
path: "/project/{project-slug}/envvar"
tags: ["Project"]
---

# Create an environment variable

`POST /project/{project-slug}/envvar`

Creates a new environment variable.

## Path parameters

- `project-slug` string, required

## Request body

- object — An environment variable request requires a name and a value
  - `name` string, required — The name of the environment variable.
  - `value` string, required — The value of the environment variable.

## Response `201`

The environment variable.

- object — An environment variable is a map containing a value and an optional timestamp.
  - `name` string, required — The name of the environment variable.
  - `value` string, required — The value of the environment variable.
  - `created-at` string — The creation timestamp of the environment variable.

## Other responses

- `default` — Error response.

---

[API](https://skmtc.net/circleci/apis/api-v2.md) · [All operations](https://skmtc.net/circleci/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/circleci/api-v2/versions/b9c0e0c24058/schema)
