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

Create an app key

Makes another publishable key or secret token for a tenant, with its own rules: the origins it works from, how fast it can call, the luna types it reaches and when it expires. A secret token is shown once, in this response.

POST/_luna/tenants/{tenant}/keys
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.

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 new key.

idstringrequired

The key's id, for changing, rotating or revoking it.

kindstringrequired

publishable or secret.

keystringrequired

The key itself. A secret token is shown only this once.

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 POST 'https://luna.example.com/_luna/tenants/string/keys' \
  -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
{
  "id": "string",
  "kind": "string",
  "key": "string"
}

Was this page helpful?