Skip to main content

set_secret

Create or update a secret. Reference it from Gherkin as {{secret:NAME}}. The value is encrypted before storage and can never be read back — it's decrypted only server-side when a run or generation is dispatched.

Request

PUT /api/v1/ops/projects/{project}/secrets/{name}
ParameterInTypeRequiredDescription
projectpathstringyesThe project's public id.
namepathstringyesThe secret name ([A-Za-z_][A-Za-z0-9_]*).
valuebodystringyesThe value. Must be non-empty.
curl -X PUT -H "Authorization: Bearer $TESTVIBE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"value": "sk_live_…"}' \
"$TESTVIBE_SERVER/api/v1/ops/projects/$PROJECT/secrets/MAILSLURP_API_KEY"

Response

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

Errors

HTTPWhen
400 invalid_requestInvalid environment name, or empty value.
404 not_foundNo such project in this workspace.
409 secrets_unavailableThe server has no secret-protection key configured (self-hosted misconfiguration).