Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview

Set a secret

Sets a secret of a tenant to the text in the body. The tenant’s code reads it as an environment variable of the same name. Setting a secret deploys a new version with the same code, so that running lunas take it up.

PUT/_luna/secrets/{tenant}/{name}
Authorization
AuthorizationBearer token · headerrequired

An account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.

Scopes:secrets:write
Path parameters
tenantstringrequired

The tenant, by its full name.

namestringrequired

The secret's name: capital letters, digits and underscores, not starting with a digit.

Request body
requiredtext/plain

The secret's value, as UTF-8 text of at most 64 KiB.

string
Responses
200

The secret is set.

versioninteger<int64> | null

The version the tenant now runs, which has the change. Null when nothing is deployed to the tenant yet.

min 0
default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Authorization
Parameters
Bodytext/plain
Request
curl -X PUT 'https://luna.example.com/_luna/secrets/string/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: text/plain' \
  -d 'string'
Response
{
  "version": 0
}

Was this page helpful?