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}
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
project | path | string | yes | The project's public id. |
name | path | string | yes | The variable name ([A-Za-z_][A-Za-z0-9_]*). |
value | body | string | yes | The value. Empty string allowed. |
- cURL
- CLI
- MCP
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"
testvibe vars set BASE_CURRENCY EUR
Tool set_variable — required name and value, optional project.
Response
{ "ok": true, "name": "BASE_CURRENCY" }
Errors
| HTTP | When |
|---|---|
400 invalid_request | Invalid environment name, or missing value. |
404 not_found | No such project in this workspace. |