Skip to content

Import a .env file into an environment

POST/api/v1/deploy/environments/{id}/variables/import

Needs an API key in the Authorization header.

On this page

Parameters

FieldInTypeDescription
idrequiredpathstring
  • format: uuid
formatquerystring
text answers in plain text instead of JSON
  • one of: json, text

Request body

FieldTypeDescription
textrequiredstring
  • min length: 1
  • max length: 262144
secretboolean
  • default: true
redeployboolean
Redeploy the services this reaches so they pick it up now. Needs the right to deploy.
  • default: false
JSON schema
{
  "type": "object",
  "properties": {
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 262144
    },
    "secret": {
      "type": "boolean",
      "default": true
    },
    "redeploy": {
      "type": "boolean",
      "default": false,
      "description": "Redeploy the services this reaches so they pick it up now. Needs the right to deploy."
    }
  },
  "required": [
    "text"
  ]
}

Example request

curl -X POST "https://polaris.example.com/api/v1/deploy/environments/{id}/variables/import" \
  -H "Authorization: Bearer $POLARIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "string",
  "secret": true,
  "redeploy": false
}'

Responses

StatusMeaning
200OK

Can also answer the common errors 400, 401, 403, 404, 429. See common errors