---
title: "Upload environment variables"
method: POST
path: "/api/v1/projects/{projectRef}/envvars/{env}/import"
tags: ["envvars"]
---

# Upload environment variables

`POST /api/v1/projects/{projectRef}/envvars/{env}/import`

## Request

- Base URL: `https://api.trigger.dev`
- URL: `https://api.trigger.dev/api/v1/projects/{projectRef}/envvars/{env}/import`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
- TypeScript: <https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api/docs/api/v1/projects/:projectRef/envvars/:env/import/post.ts> (a function with typed inputs; its response is checked against the schema)

Upload mulitple environment variables for a specific project and environment.

## Request body

- object
  - `variables` EnvVar[], required
    - `name` string, required
    - `value` string, required
  - `override` boolean: Whether to override existing variables or not

## Response `200`

Environment variables imported successfully

- SucceedResponse
  - `success` boolean, required

## Other responses

- `400`: Invalid request parameters or body
- `401`: Unauthorized request
- `404`: Resource not found

## Changes

- **2024-06-21** `b6fb6782171f`: 1 breaking
  - removed the media type `multipart/form-data` from the request body
- **2024-05-31** `3c0abddc2b32`: 2 info
  - the endpoint scheme security `secretKey` was added to the API
  - the endpoint scheme security `apiKey` was removed from the API

[Operation history](https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api/changes/api/v1/projects/:projectRef/envvars/:env/import/post.md)

---

[API](https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api.md) - [All operations](https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/triggerdotdev/apis/trigger-dev-v3-rest-api/revisions/441161111493?raw)
