Skip to main content
POST
/
projects
/
{projectId}
/
environments
/
{environmentId}
/
variables
Add an environment variable
curl --request POST \
  --url {schemes}://api.upsun.com/projects/{projectId}/environments/{environmentId}/variables \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "value": "<string>",
  "attributes": {},
  "is_json": true,
  "is_sensitive": true,
  "visible_build": true,
  "visible_runtime": true,
  "application_scope": [
    "<string>"
  ],
  "is_enabled": true,
  "is_inheritable": true
}
'
{
  "status": "<string>",
  "code": 123
}

Authorizations

Authorization
string
header
required

Path Parameters

projectId
string
required
environmentId
string
required

Body

application/json
name
string
required

Name of the variable

value
string
required

Value of the variable

attributes
Arbitrary attributes · object

Arbitrary attributes attached to this resource

is_json
boolean

The variable is a JSON string

is_sensitive
boolean

The variable is sensitive

visible_build
boolean

The variable is visible during build

visible_runtime
boolean

The variable is visible at runtime

application_scope
string[]

Applications that have access to this variable

is_enabled
boolean

The variable is enabled on this environment

is_inheritable
boolean

The variable is inheritable to child environments

Response

default - application/json
status
string
required

The status text of the response

code
integer
required

The status code of the response