跳转到内容

environments.setVariable

POST
/environments/{environmentId}/variables
curl --request POST \
--url https://example.com/api/environments/example/variables \
--header 'Content-Type: application/json' \
--data '{ "key": "example", "value": "example", "kind": "plain-config", "exposure": "build-time", "scope": "defaults", "isSecret": true }'

Sets an environment variable with explicit kind, exposure, scope, and secret handling. Public docs: /docs/environments/variables/precedence/#environment-variable-precedence

environmentId
required
string
>= 1 characters
Media type application/json
object
key
required
string
>= 1 characters
value
required
string
kind
required
string
Allowed values: plain-config secret provider-specific deployment-strategy
exposure
required
string
Allowed values: build-time runtime
scope
string
Allowed values: defaults system organization project environment resource deployment
isSecret
boolean

OK

Media type application/json
null
Example generated
example