Create an environment variable
Sets a variable on the environment, as a key-value pair or a file.
/project/{project_id}/environment/{environment_id}/variableAuthorizationBearer token (JWT) · headerrequiredJWT token passed in the Authorization header using the Bearer <token> format.
project_iduuidrequiredThe unique identifier for the project
environment_iduuidrequiredThe unique identifier of the environment
application/jsonkeystringrequiredVariable key identifier.
var_typevariable_typerequiredVariable value type
key_valuefilevaluestringrequiredVariable value.
file_pathstringRequired when var_type is file. Must be an absolute path.
Variable created successfully
iduuidrequiredA universally unique identifier (UUID) string
organization_iduuidrequiredA universally unique identifier (UUID) string
project_iduuidrequiredA universally unique identifier (UUID) string
environment_iduuid | nullShow propertiesHide properties
string<uuid>nullvisibilityvariable_visibilityrequiredVariable scope visibility
projectenvironmentcomponentvar_typevariable_typerequiredVariable value type
key_valuefilekeystringrequiredVariable key identifier.
is_secretbooleanrequiredIndicates whether the value is stored in Vault.
managedbooleanrequiredIndicates whether the variable is managed by the engine and cannot be updated or deleted through the API.
valuestring | nullVariable value. Null for secret variables.
file_pathstring | nullAbsolute file path for file variables.
component_kindcomponent_kind | nullShow propertiesHide properties
stringnullcomponent_iduuid | nullShow propertiesHide properties
string<uuid>nullcreated_atstring<date-time>requiredThe timestamp when the variable was created.
updated_atstring<date-time>requiredThe timestamp when the variable was last updated.
Error
codeinteger<int32>requiredmessagestringrequiredreasonstringOptional stable machine-readable reason for programmatic error handling