---
title: "Import variables"
method: POST
path: "/variable/import"
tags: ["Variable Main Calls"]
---

# Import variables

`POST /variable/import`

## Request

- Base URL: `https://api.qovery.com`
- URL: `https://api.qovery.com/variable/import`
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/qovery/apis/qovery-api/docs/variable/import/post.ts> (a function with typed inputs; its response is checked against the schema)

Import environment variables in a defined scope, with a defined visibility.

## Query parameters

- `service_id` string, uuid, required
- `service_type` 'APPLICATION' | 'CONTAINER' | 'JOB' | 'HELM' | 'TERRAFORM', required: type of the service

## Request body

- VariableImportRequest
  - `overwrite` boolean, required
  - `vars` object[], required
    - `name` string, required
    - `value` string, required
    - `scope` 'APPLICATION' | 'BUILT_IN' | 'ENVIRONMENT' | 'PROJECT' | 'CONTAINER' | 'JOB' | 'HELM' | 'TERRAFORM', required
    - `is_secret` boolean, required

## Response `201`

Import environment variables

- VariableImport
  - `total_variables_to_import` number, required
  - `successful_imported_variables` object[], required
    - `name` string, required
    - `value` string: Optional if the variable is secret
    - `scope` 'APPLICATION' | 'BUILT_IN' | 'ENVIRONMENT' | 'PROJECT' | 'CONTAINER' | 'JOB' | 'HELM' | 'TERRAFORM', required
    - `is_secret` boolean, required

## Other responses

- `400`: Bad request
- `401`: Access token is missing or invalid
- `403`: Access forbidden
- `404`: Resource not found

---

[API](https://skmtc.dev/qovery/apis/qovery-api.md) - [All operations](https://skmtc.dev/qovery/apis/qovery-api/llms.txt) - [OpenAPI document](https://skmtc.dev/qovery/apis/qovery-api/revisions/93c4960a44ba?raw)
