environments.setVariable
POST
/environments/{environmentId}/variables
const url = 'https://example.com/api/environments/example/variables';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"key":"example","value":"example","kind":"plain-config","exposure":"build-time","scope":"defaults","isSecret":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” environmentId
required
string
Request Body required
Section titled “Request Body required ” Media type application/json
object
key
required
string
value
required
string
kind
required
string
exposure
required
string
scope
string
isSecret
boolean
Responses
Section titled “ Responses ”OK
Media type application/json
null
Example generated
example