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

Update an app key

Changes a key’s name or rules. Only the fields you send change. The main secret token has no rules to change.

PATCH/_luna/tenants/{tenant}/keys/{id}
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:keys:write
Path parameters
tenantstringrequired

The tenant, by its full name.

idstringrequired

The key's id.

Request body
requiredapplication/json
kindstring | null

publishable, which is the default, or secret. Only read when a key is made.

default: null
namestring | null

A name to tell the key by.

default: null
originsstring[] | null

The origins a browser can use the key from, such as https://app.example.com. Empty means any origin.

default: null
ratePerSecondnumber<double> | null

The most requests a second the key can make. More than 0.

default: null
typesstring[] | null

The luna types the key can call. Empty sets no such limit.

default: null
expiresIninteger<int64> | null

How long the key works, in seconds from now.

min 0 · default: null
Responses
200

The key is changed.

okbooleanrequired

Always true.

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
Bodyapplication/json
Request
curl -X PATCH 'https://luna.example.com/_luna/tenants/string/keys/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "kind": null,
  "name": null,
  "origins": null,
  "ratePerSecond": null,
  "types": null,
  "expiresIn": null
}'
Response
{
  "ok": true
}

Was this page helpful?