Skip to main content

set_variable

Create or update a variable. Reference it from Gherkin as {{var:NAME}}; it's injected as an environment value into runs and generation. An empty string is a valid value.

Request

PUT /api/v1/ops/projects/{project}/variables/{name}
ParameterInTypeRequiredDescription
projectpathstringyesThe project's public id.
namepathstringyesThe variable name ([A-Za-z_][A-Za-z0-9_]*).
valuebodystringyesThe value. Empty string allowed.
curl -X PUT -H "Authorization: Bearer $TESTVIBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"value": "EUR"}' \
"$TESTVIBE_SERVER/api/v1/ops/projects/$PROJECT/variables/BASE_CURRENCY"

Response

{ "ok": true, "name": "BASE_CURRENCY" }

Errors

HTTPWhen
400 invalid_requestInvalid environment name, or missing value.
404 not_foundNo such project in this workspace.