Store or replace an egress secret
PUT
/v1/secrets/{secret_id}
const url = 'http://127.0.0.1:8080/v1/secrets/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"cache_ttl_secs":0,"value":"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 http://127.0.0.1:8080/v1/secrets/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "cache_ttl_secs": 0, "value": "example" }'Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” secret_id
required
Secret UUID or display name.
string
Secret UUID or display name.
Request Body required
Section titled “Request Body required ”Secret set request.
Media type application/json
Secret set request.
object
cache_ttl_secs
Worker-side cache TTL in seconds.
integer format: uint32
value
required
Secret value.
string
Responses
Section titled “ Responses ”Response envelope.
Media type application/json
Response envelope.
object
data
required
Secret response object.
object
cache_ttl_secs
required
Worker-side cache TTL in seconds.
integer format: uint32
display_name
required
User-chosen display name.
string
id
required
Stable secret UUID.
string
value_preview
Server-masked preview (first and last chars) of the value, for display only. Never the full value.
string
Example generated
{ "data": { "cache_ttl_secs": 1, "display_name": "example", "id": "example", "value_preview": "example" }}Missing, malformed, or rejected bearer token
Media type application/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "already_exists" }}The bearer token is not allowed to perform this action
Media type application/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "already_exists" }}The requested resource was not found
Media type application/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "already_exists" }}The request conflicts with current resource state
Media type application/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "already_exists" }}Validation or application error
Media type application/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "already_exists" }}Rate limit exceeded
Media type application/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "already_exists" }}Upstream service is unavailable
Media type application/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "already_exists" }}Upstream request timed out
Media type application/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "already_exists" }}default
Section titled “default ”Error response
Media type application/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "already_exists" }}