Skip to content

Set a secret

PUT
/environments/{environment_id}/secrets/{name}
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.

environment_id
required
string
name
required
string
Media typeapplication/json
object
value
required
string
<= 16384 characters
mode
string
Allowed values: placeholder inside
hosts
Array<string>
<= 20 items

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"
}