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

Create a tenant

Adds a tenant to an environment. A tenant has its own lunas, data, keys and secrets, apart from every other tenant. It runs nothing until you deploy to it. The response holds its two main credentials.

POST/_luna/tenants
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:tenants:write
Request body
requiredapplication/json
parentstringrequired

The environment to add it to, by the full name of its default tenant.

namestringrequired

The new tenant's name within the environment: lower-case letters, digits and single dashes.

labelsobject

Your own tags, for finding and grouping tenants.

Responses
200

The new tenant.

tenantstringrequired

The tenant's full name.

publishableKeystringrequired

Its main publishable key, which is safe to ship in a client.

apiTokenstringrequired

Its main secret token. Keep it on your servers.

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
Bodyapplication/json
Request
curl -X POST 'https://luna.example.com/_luna/tenants' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "parent": "string",
  "name": "string",
  "labels": {
    "property1": "string",
    "property2": "string"
  }
}'
Response
{
  "tenant": "string",
  "publishableKey": "string",
  "apiToken": "string"
}

Was this page helpful?