Create or replace a secret.
PUT
/api/v1/projects/{project}/environments/{environment}/secrets/{secret}
const url = 'https://example.com/api/v1/projects/example/environments/example/secrets/example';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"data":{"additionalProperty":"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://example.com/api/v1/projects/example/environments/example/secrets/example \ --header 'Content-Type: application/json' \ --data '{ "data": { "additionalProperty": "example" } }'Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”project
required
string
Project name
environment
required
string
Environment short name
secret
required
string
Secret name
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
data
required
Key → UTF-8 value. Replaces the whole secret.
object
key
additional properties
string
Examplegenerated
{ "data": { "additionalProperty": "example" }}Responses
Section titled “Responses”Media typeapplication/json
object
name
required
string
keys
required
Key names only; values are never returned.
Array<string>
created_at
string | null
Examplegenerated
{ "name": "example", "keys": [ "example" ], "created_at": "example"}A secret with this name exists and is not managed by Kuben
Media typeapplication/json
Problem Details body.
object
code
required
Stable machine-readable code, e.g. forbidden.
string
title
required
Short human readable title.
string
status
required
HTTP status.
integer format: int32
detail
Details, if safe to expose.
string | null
Example
{ "code": "forbidden"}Media typeapplication/json
Problem Details body.
object
code
required
Stable machine-readable code, e.g. forbidden.
string
title
required
Short human readable title.
string
status
required
HTTP status.
integer format: int32
detail
Details, if safe to expose.
string | null
Example
{ "code": "forbidden"}