Define (or overwrite) a secret at a scope (ADR-0014). The value is stored envelope-encrypted and is **never** returned by any endpoint. Administering secrets requires the Administer capability.
POST
/v1/secrets
const url = 'https://example.com/v1/secrets';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"environment":"example","name":"example","org":"example","repo":"example","value":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/secrets \ --header 'Content-Type: application/json' \ --data '{ "environment": "example", "name": "example", "org": "example", "repo": "example", "value": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
POST /v1/secrets body: define (or overwrite) a secret at a scope. The
value is write-only — no endpoint ever returns it.
object
environment
Environment, for an environment-scoped secret (requires repo).
string | null
name
required
Secret name (the key steps reference).
string
org
required
Owning org (required).
string
repo
Repo, for a repo- or environment-scoped secret.
string | null
value
required
Secret value — stored envelope-encrypted, never returned.
string
Examplegenerated
{ "environment": "example", "name": "example", "org": "example", "repo": "example", "value": "example"}Responses
Section titled “Responses”Secret stored
Secrets not configured