---
search:
  tags:
    - Domains
    - POST
seo:
  description: >-
    Adds a domain of your own to a tenant. Its HTTP routes are served there once
    the… Reference for the POST /_luna/domains/{tenant} endpoint in the Luna
    API.
sidebar:
  label: Add a domain
  badge: POST
title: Add a domain
type: openapi-operation
---
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}`

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

- `name` (string, required) — The domain, such as \`shop.example.com\`.

Request body example:

```json
{
  "name": "string"
}
```

**Responses**

- `200` — The domain, with the records to create.
- `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"
}
```
