Replace the agents that may receive a workspace variable
Owners and admins; never an API key. The whole set is replaced. grant_all: true takes no agents. If-Match: <grant_version> is required, so two edits of the same grants cannot overwrite each other: the later one answers 412. Writes a set_env_variable_grants receipt with the set before and after.
Auth: cookie session only; no scope. Idempotency-Key: ignored.
cookieSession__Host-werft_session<token>For the web console: the browser session cookie set by POST /v1/auth/login. It holds the scopes of the user's workspace role (owner: all; admin and member: all but sessions:recover). Requests other than GET must also send X-Requested-With: werft-web.
name*stringThe variable's name.
1 <= lengthIf-Match*stringThe grant_version last read, as a number (an entity tag's quotes are allowed). A different one answers 412 VERSION_MISMATCH; none answers 428 PRECONDITION_REQUIRED.
1 <= lengthX-Requested-With?"werft-web"Required with a cookie session: the literal werft-web.
"werft-web"application/json- body
grant_all*booleanagents*array<>The grants now held, and their new grant_version.
application/json- response
name*string^[A-Z][A-Z0-9_]{0,63}$grant_version*integer0 < value <= 9007199254740991curl -X PUT 'https://example.com/v1/workspace/variables/string/grants' \ -H 'If-Match: string' \ -H 'Content-Type: application/json' \ -d '{ "grant_all": false, "agents": [ { "id": "8d2c4f1a-6b3e-4a9d-b7c5-2e1f0a9b8c7d" } ]}'{ "name": "REGION", "grant_version": 43}