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

Add a domain

Adds a domain of your own to a tenant. Its HTTP routes are served there once the domain’s DNS records prove it yours. The response lists the records to create. Where the deployment gets certificates by itself, Luna gets one for the domain once it is verified and renews it.

POST/_luna/domains/{tenant}
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:environments:write
Path parameters
tenantstringrequired

The tenant, by its full name. An environment's domain belongs to its default tenant.

Request body
requiredapplication/json
namestringrequired

The domain, such as shop.example.com.

Responses
200

The domain, with the records to create.

namestringrequired

The domain, in lower case.

stateDomainStaterequired

Where a domain stands.

Allowed:pendingverifiedactivefailed
errorstring | null

Why it is not verified yet, or why Luna could not get its last certificate.

recordsDnsRecord[]required

The records to create. Either proves the domain yours. The CNAME also sends its requests to Luna. For a domain that cannot have a CNAME (an apex domain), create the TXT record and point its A records at the same addresses as the CNAME's target.

Show properties
Array of DnsRecord
typestringrequired

CNAME or TXT.

namestringrequired

The record's name.

valuestringrequired

What it holds.

purposestringrequired

traffic for the record that sends requests to Luna, ownership for one that only proves the domain yours.

createdMsinteger<int64>required

When it was added, in milliseconds since the epoch.

min 0
verifiedMsinteger<int64> | null

When its records were first found, in milliseconds since the epoch.

min 0
notAfterinteger<int64> | null

When its certificate runs out, in seconds since the epoch.

certificatestring | null

Where its certificate came from: acme (Luna got it) or uploaded.

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/domains/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string"
}'
Response
{
  "name": "string",
  "state": "pending",
  "error": "string",
  "records": [
    {
      "type": "string",
      "name": "string",
      "value": "string",
      "purpose": "string"
    }
  ],
  "createdMs": 0,
  "verifiedMs": 0,
  "notAfter": 0,
  "certificate": "string"
}

Was this page helpful?