Skip to content

Set a variable on a service

POST/api/v1/deploy/services/{id}/variables

Needs an API key in the Authorization header.

On this page

Parameters

FieldInTypeDescription
idrequiredpathstring
A service id, or project/service, or project/environment/service
formatquerystring
text answers in plain text instead of JSON
  • one of: json, text

Request body

FieldTypeDescription
keyrequiredstring
  • pattern: ^[A-Za-z_][A-Za-z0-9_]*$
  • max length: 256
valuerequiredstring
  • max length: 65536
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": {
    "key": {
      "type": "string",
      "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
      "maxLength": 256
    },
    "value": {
      "type": "string",
      "maxLength": 65536
    },
    "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": [
    "key",
    "value"
  ]
}

Example request

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

Responses

StatusMeaning
200OK

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