Set a secret
PUT
/environments/{environment_id}/secrets/{name}
const url = 'https://api.global.stillbox.example/v1/environments/example/secrets/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"value":"example","mode":"placeholder","hosts":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.global.stillbox.example/v1/environments/example/secrets/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "value": "example", "mode": "placeholder", "hosts": [ "example" ] }'The value is sealed in this region and never shown again. It reaches sandboxes using the environment at once:
as a placeholder the credential broker swaps on requests to hosts, or, with mode inside (allowed only when
the organization’s secrets_inside switch is on), as the real value.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”environment_id
required
string
name
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
value
required
string
mode
string
hosts
Array<string>
Responses
Section titled “Responses”Set
The request is invalid
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}The API key is missing or invalid
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}Only an owner can do this (owner_only), or the invitation is for another address (not_invited)
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}No such sandbox in your organization (or no such file)
Media typeapplication/json
object
code
required
string
message
required
string
Example
{ "code": "not_found"}