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

Upload a certificate

Serves a certificate you supply for the domain, for a deployment that cannot get one by itself (a site without internet access). The domain must be verified first, except for an operator of the deployment, whose upload verifies it. A certificate Luna gets later replaces it when it is close to running out.

PUT/_luna/domains/{tenant}/{name}/certificate
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.

namestringrequired

The domain.

Request body
requiredapplication/json
certstringrequired

The certificate chain, leaf first, as PEM.

keystringrequired

Its private key, as PEM.

Responses
200

The domain, serving the certificate.

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 PUT 'https://luna.example.com/_luna/domains/string/string/certificate' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "cert": "string",
  "key": "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?