---
search:
  tags:
    - Tenants
    - POST
seo:
  description: >-
    Adds a tenant to an environment. A tenant has its own lunas, data, keys and
    secrets, apart… Reference for the POST /_luna/tenants endpoint in the Luna
    API.
sidebar:
  label: Create a tenant
  badge: POST
title: Create a tenant
type: openapi-operation
---
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`

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

- `parent` (string, required) — The environment to add it to, by the full name of its default tenant.
- `name` (string, required) — The new tenant's name within the environment: lower-case letters, digits and single dashes.
- `labels` (object) — Your own tags, for finding and grouping tenants.

Request body example:

```json
{
  "parent": "string",
  "name": "string",
  "labels": {
    "property1": "string",
    "property2": "string"
  }
}
```

**Responses**

- `200` — The new tenant.
- `default` — The request failed. The status says how and \`error.message\` says why.

Response example, 200:

```json
{
  "tenant": "string",
  "publishableKey": "string",
  "apiToken": "string"
}
```
