---
title: "Update default environment variables"
method: POST
path: "/projects/{project_id}/update_default_environment_variables"
tags: ["Environment Variables"]
---

# Update default environment variables

`POST /projects/{project_id}/update_default_environment_variables`

Creates, updates, or deletes default environment variables for the specified
project. When `value` is a string, the variable is upserted. When `value` is
null, the variable is deleted.

## Path parameters

- `project_id` integer, required

## Request body

- UpdateDefaultEnvironmentVariablesArgs
  - `changes` DefaultEnvironmentVariableChangeArgs[], required
    - `name` string, required
    - `deploymentType` 'dev' | 'prod' | 'preview' | 'custom', required
    - `value` string, nullable — Set to a value to upsert the default environment variable with the given name and type. If null, will delete the environment variable with the given name and deployment type if it exists (and do nothing if it doesn’t exist).

## Response `200`

---

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