---
search:
  tags:
    - Domains
    - PUT
seo:
  description: >-
    Serves a certificate you supply for the domain, for a deployment… Reference
    for the PUT /_luna/domains/{tenant}/{name}/certificate endpoint in the Luna
    API.
sidebar:
  label: Upload a certificate
  badge: PUT
title: Upload a certificate
type: openapi-operation
---
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`

**Request body** (`application/json`, required)

- `cert` (string, required) — The certificate chain, leaf first, as PEM.
- `key` (string, required) — Its private key, as PEM.

Request body example:

```json
{
  "cert": "string",
  "key": "string"
}
```

**Responses**

- `200` — The domain, serving the certificate.
- `default` — The request failed. The status says how and \`error.message\` says why.

Response example, 200:

```json
{
  "name": "string",
  "state": "pending",
  "error": "string",
  "records": [
    {
      "type": "string",
      "name": "string",
      "value": "string",
      "purpose": "string"
    }
  ],
  "createdMs": 0,
  "verifiedMs": 0,
  "notAfter": 0,
  "certificate": "string"
}
```
